webpack-contrib / purifycss-webpack

UNMAINTAINED, use https://github.com/FullHuman/purgecss-webpack-plugin
MIT License
772 stars 37 forks source link

React Component compatilibility #91

Open ankibalyan opened 7 years ago

ankibalyan commented 7 years ago

is compatible with the react components and common chunks plug-in. how it should configured with this.

bebraw commented 7 years ago

The configuration discussed at the readme should be enough. You have to be careful, though, as if you generate class names dynamically, the plugin won't be able to detect them as it relies on static analysis. This means it could eliminate rules you don't want it to eliminate. To overcome that, use purify whitelist (in docs).

ankibalyan commented 7 years ago

so if I'm using bootstrap css classes in my components then I should specify each and every css class in purify's whitelist options.

bebraw commented 7 years ago

My understanding is that purify should pick up className but the only way you can say for sure is by actually trying.

ankibalyan commented 7 years ago

Thank you @bebraw I was curious about this. I'll check and let you know.