馃憢
Is there a way to add sourcemaps support for node-sass
?
Only way i've found is to create a .sassrc
with this config (inline-sourcemaps here) for example:
{
"sourceMap": true,
"sourceMapEmbed": true
}
But no way to disable it when running parcel build
command.
Thanks for your work.
This is really a feature request for CSS source maps. We should enable/disable them based on the CLI flag for sourcemaps that is already used for JS.
@devongovett hey is cli flags still available to disable then sourcemap?
I just installed the latest 1.6.2 version and found it shows unknown option: --no-source-maps
when trying to disable it.
// package.json
...
"scripts": {
"start": "parcel index.html --open",
"build": "parcel build index.html --no-source-maps"
},
"devDependencies": {
"parcel-bundler": "^1.6.2",
"typescript": "^2.7.2"
},
"dependencies": {
"react": "^16.2.0",
"react-dom": "^16.2.0"
}
...
both local and global are 1.6.2 version.
there is also no such option in help infos when I typed parce build -h
in terminal, other flag works well tho.
@shadeofgod the build sourcemaps haven't been released yet, they are only on the current master branch of the github repo
@DeMoorJasper this is a little bit weird, it do generated sourcemaps at the first time when I ran build command, later after I posted here I removed whole local node_modules directory and npm install everything again, oops no more sourcemaps for the build this time.
btw docs says it was enabled by default tho.
@shadeofgod The docs is my bad, it should've said is enabled by default in watch mode, as it's not been released yet on build as I said before.
In the next release it will however be enabled by default in production, the sourcemaps inside your output folder is probably from the watch command? As they probably use the same output directory, otherwise this would be very weird or u were using the github version.
@DeMoorJasper yeah you are right, I found it. It was generated by that npm start
command. And build command won't remove all the files at first in dist/ directory(seems it simply replaces content with same file name) and the sourcemaps file just stays there all the time so I thought it was from production mode.
thanks for your quick response!
I've opened a PR to implement this feature: https://github.com/parcel-bundler/parcel/pull/1373
Note that sass test are failing for now, and I don't really understand why.
If someone with a deeper understanding of the Parcel code base than me could take a look and see what's wrong, this would help me a lot !
Sass source maps are not working for me.
I have created a .sassrc
file with the proper config, but I get to source mapping whatsoever.
PR coming along for this in #2489
Most helpful comment
I've opened a PR to implement this feature: https://github.com/parcel-bundler/parcel/pull/1373
Note that sass test are failing for now, and I don't really understand why.
If someone with a deeper understanding of the Parcel code base than me could take a look and see what's wrong, this would help me a lot !