webpack-contrib / css-loader

CSS Loader
MIT License
4.3k stars 602 forks source link

[feature request] add css-loader-@import-handled hooks #773

Closed Aqours closed 6 years ago

Aqours commented 6 years ago

Do you want to request a feature or report a bug? feature

What is the current behavior? See cssnano-issues-604

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior? The comment in test.css should be discarded. (test.css file should be handled by postcss-loader)

If this is a feature request, what is motivation or use case for changing the behavior? We want raw css file which mix with less or scss file, can be handled by postcss-loader.

loader workflow

less-loader/scss-loader 
-> [postcss-loader] 
-> css-loader-@import-handled 
-> [postcss-loader] (using hooks or plugins that we can handle raw css mixed with less/scss by postcss-loader)
-> css-loader-other-tasks
-> style-loader/other-loader

Please mention other relevant information such as your webpack version, Node.js version and Operating System. webpack 4, node 10, windows 10

alexander-akait commented 6 years ago

@Aqours not related to css-loader, we don't minimize code (included remove comments)

Aqours commented 6 years ago

In this case, postcss-loader cannot handle css file which I want to use autoprefixer, cssnano or other postcss-plugins. It's not only related to minimize code.

alexander-akait commented 6 years ago

@Aqours i can't understand what you mean, please provide more information, maybe you need this https://github.com/webpack-contrib/css-loader#importloaders?

Aqours commented 6 years ago

It seems to be working well. Thank you for your patient answer