Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to debug css as create-react-app strips out sourcemap references. #2983

Closed
webegguk opened this issue Aug 20, 2017 · 2 comments
Closed

Comments

@webegguk
Copy link

webegguk commented Aug 20, 2017

I have the latest of everything and have come some way to getting to grips with create-react-app, which is great but I am used to using developer tools to debug css, which I intend to use heavily with things like susy grid as my app develops.
Basically, I have installed node-sass-chokidar as explained here, to compile sass on the fly and have a nice setup, only to find that the index.html file is generated dynamically and each css file put inline into the head of this document, stripping out the sourcemap links so everything is shown inline in Developer tools.
As part of the scripts section in package.json, I have put the build-css and watch-css lines, to which I have added the sourcemap generation. This section currently looks like this:

"scripts": {
    "build-css": "node-sass-chokidar --source-map true --include-path ./src --include-path ./node_modules src/ -o src/",
    "watch-css": "npm run build-css && node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/ --watch --recursive",
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }

Could anyone help me to understand where the css is being stripped out and how to link to css files directly or hook up sourcemaps again?

@d-amit
Copy link

d-amit commented Sep 6, 2017

I'm having similar issues and so far every post that I've read mentioned ejecting the configurations to get this working. I'm hoping there is a way to see generated sourcemap in dev w/o ejecting.

@gaearon
Copy link
Contributor

gaearon commented Jan 8, 2018

My understanding is first-class support for Sass would solve this so I'm merging this into #2498.

@gaearon gaearon closed this as completed Jan 8, 2018
@lock lock bot locked and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants