Remove css-loader and style-loader from the postcss block#293
Remove css-loader and style-loader from the postcss block#293andywer merged 3 commits intoandywer:release-2.0from
Conversation
andywer
left a comment
There was a problem hiding this comment.
Looks good to me 👍
Thanks, @marcofugaro!
Does anyone else wanna review before merging?
vlad-zhukov
left a comment
There was a problem hiding this comment.
Nice! A long awaited feature for me by the way!
|
I thought it was that way all along 😅 |
|
Glad you guys like it! Do you think we should treat this way also the sass block? |
|
@marcofugaro Excellent point! We probably should to keep it consistent, principle of least surprises. |
|
@andywer the sass loader is different, the files have a different extension. This next basic example will not work module.exports = createConfig([
css(),
sass(/* node-sass options */)
])You have to use sass and the css block inside a What do you think? Wanted to check with you. Should the basic sass block usage become const { createConfig } = require('@webpack-blocks/webpack')
const { css } = require('@webpack-blocks/assets')
const sass = require('@webpack-blocks/sass')
module.exports = createConfig([
match('*.{sass,scss}' [
css(),
sass(/* node-sass options */)
])
])``` |
|
We could make |
|
That's awesome! |
|
Ahh, we haven‘t merged this PR yet... Any objections why not to apply similar changes to the SASS loader (see comments above)? |
|
@andywer, no objections from me 👍 On a sidenote I've got a feeling the |
100% agreed! 👍 |
Hey, this solves an issue I had with the postcss block, but it changes the way the block is used. So feel free to start a discussion, or tell me if you find a better solution to my problem.
Basically I wanted to use postcss in the production build with the mini-css-extract-plugin. To do this I need to disable the
style-loader. I can do that easily in the css block usingstyleLoader: false. But I couldn't find a way to do it with the postcss block.It seemed to me a cleaner solution would be to remove the
style-loaderandcss-loaderrather than adding astyleLoaderoption to the postcss plugin.Let me know if you have anything against this or if I'm missing the reason the
style-loaderandcss-loaderwere there in the first place.