css-minimizer-webpack-plugin icon indicating copy to clipboard operation
css-minimizer-webpack-plugin copied to clipboard

style-loader Supported?

Open MitchTalmadge opened this issue 4 years ago • 4 comments

Documentation Is:

  • [ ] Missing
  • [ ] Needed
  • [x] Confusing
  • [ ] Not Sure?

Please Explain in Detail...

I am unsure if this plugin supports style-loader. In my attempts to get it working, I have not seen any differences between using this plugin and not using it; however, I am unsure if this is my fault or because the plugin does not support it.

Your Proposal for Changes

Document whether this plugin works for style-loader or if it requires something like mini-css-extract-plugin.

MitchTalmadge avatar Apr 09 '21 22:04 MitchTalmadge

No, right now you need use cssnano as postcss plugin, but let's mark this as feature for better DX

alexander-akait avatar Apr 10 '21 12:04 alexander-akait

@alexander-akait What would be the config to make cssnano and postcss-loader work with style-loader?

tunnelpuzzle avatar Jun 18 '23 05:06 tunnelpuzzle

@tunnelpuzzle Currently you can use cssnano as a plugin for postcss for style which use style-loader

alexander-akait avatar Jun 18 '23 16:06 alexander-akait

@alexander-akait Is it possible to do that if you're also using css-loader? Not using css-loader that works but adding css-loader seems to make it not minify.

Edit: Setting sourceMap: false in css-loader seems to make it work.

tunnelpuzzle avatar Jun 24 '23 23:06 tunnelpuzzle