webpack-contrib / postcss-loader

PostCSS loader for webpack
MIT License
2.86k stars 211 forks source link

Invalid default specified for postcssOptions.config #626

Closed Knagis closed 1 year ago

Knagis commented 1 year ago

Documentation Is:

https://github.com/webpack-contrib/postcss-loader#config

Please Explain in Detail...

https://github.com/webpack-contrib/postcss-loader#config specifies the default is undefined which isn't really true - if the value is undefined then https://github.com/webpack-contrib/postcss-loader/blob/master/src/index.js#L40 assumes true.

Your Proposal for Changes

Change the default in documentation from undefined to true

Knagis commented 1 year ago

I would also suggest to highlight a recommendation to set postcssOptions in webpack config with config: false as a performance optimization. In one of my builds it seems doing this has helped me to decrease build time from 42->38 seconds (~10k TS and PostCSS modules). My postcss config was rather heavy (a func, not just an object, plugin factory, not plugin instances etc.).

alexander-akait commented 1 year ago

Hello, yes, you are right, let's do it, do you want to send a PR?

Knagis commented 1 year ago

PR created: #627