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
[sass-loader] always return compressed CSS file #763
Comments
Probably because dart-sass accept only two options outputStyle...
|
Look here https://github.com/webpack-contrib/sass-loader/blob/master/src/getSassOptions.js#L68, by default we use |
Why it is not recommended? I want to minify my CSS later with CSSO and I wanted to disable SASS minification for that, but now I'm confused. |
This bug caused some really annoying problems for us, which I just wasted many hours trying to figure out. Seems like it was merged as a "bugfix" #723, but to me it looks like a breaking change. With the Here's a related bug with further explanation: |
I think this is more of a convention of minifying all resources for production. I simply turned off SASS minification and had no problems |
I'd rather have the postcss-loader get the same input in production as in development. I use a minifier as the last webpack loader for css files in production, so I don't need sass-loader to magically determine whether to minify its output or not. It would make more sense that people who use sass-loader by itself pass in |
Time has passed so long, hasn't this issue been taken seriously? |
The root cause is loaderContext.mode is undefined. so isProductionLikeMode function return true
|
how do you turn it off? no matter what outputStyle I pass to sass it returns compressed. 'expanded' or 'compressed' result in compressed. |
Since a recent update my CSS output are always compressed even without minifier configured.
After a long investigation, I found out sass-loader use dart-sass with
outputStyle:'compressed'
option by default.To fix it, I've forced
outputStyle: 'expanded'
like so:IMO, sass-loader should not compressed CSS file, there are other tools for that.
Cheers
The text was updated successfully, but these errors were encountered: