purgecss-webpack-plugin icon indicating copy to clipboard operation
purgecss-webpack-plugin copied to clipboard

Ability to load configuration from purgecss.config.js

Open akrawchyk opened this issue 6 years ago • 0 comments

I'd like to provide defaults for purgecss-webpack-plugin and allow the users of my plugin to provide their own whitelist configuration. The docs indicate we could add these options in the purgecss.config.js file: https://www.purgecss.com/configuration#configuration-file

But, purgecss doesn't load configuration from this file if its passed an object: https://github.com/FullHuman/purgecss/blob/master/src/index.js#L41-L42

And purgecss-webpack-plugin passes an object to purgecss: https://github.com/FullHuman/purgecss-webpack-plugin/blob/master/src/index.js#L118

So that ignores the ability to load configuration from a file.

Maybe this is an issue of wanting my cake and eating it too, but it would be nice to be able to configure these options separate from the webpack configuration.

akrawchyk avatar Aug 20 '19 18:08 akrawchyk