webpack-contrib / purifycss-webpack

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

How to use this with bootstrap? #100

Closed andersontr15 closed 7 years ago

andersontr15 commented 7 years ago

How to use this with bootstrap and react? I'm importing bootstrap into a bundle right now.

bebraw commented 7 years ago

How do you refer to Bootstrap classes?

andersontr15 commented 7 years ago

With react's className attribute.

bebraw commented 7 years ago

@andersontr15 Ok, as long as it's className="foobar" kind of style (nothing dynamic), the tooling just might pick it up. Use the verbose option to get more insight.

If you can't get it to work, please set up a small repository for me to study.

andersontr15 commented 7 years ago

Yeah I was able to get it to work with bootstrap but now my css modules aren't being picked up even with whitelisting it with 'purify'

bebraw commented 7 years ago

CSS Modules takes some extra effort. Please see the README for details.

andersontr15 commented 7 years ago

Got it to work. Don't know if anyone has tried this, but I had to add the .json files emitted by the postcss- modulesto the paths array for purifycss to get it to work.

bebraw commented 7 years ago

@andersontr15 If you have time, please make a doc PR about that. 👍