purifycss-webpack icon indicating copy to clipboard operation
purifycss-webpack copied to clipboard

React Component compatilibility

Open ankibalyan opened this issue 8 years ago • 4 comments

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

ankibalyan avatar Mar 31 '17 10:03 ankibalyan

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).

bebraw avatar Mar 31 '17 10:03 bebraw

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.

ankibalyan avatar Mar 31 '17 12:03 ankibalyan

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

bebraw avatar Mar 31 '17 12:03 bebraw

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

ankibalyan avatar Mar 31 '17 12:03 ankibalyan