FullHuman / purgecss-webpack-plugin

Purgecss plugin for webpack
MIT License
297 stars 15 forks source link

Purging Bootstrap style sheets #74

Open sjorsvanheuveln opened 5 years ago

sjorsvanheuveln commented 5 years ago

This is perhaps more a question than an issue, but one shouldn't really purge bootstrap stylesheets right? Because if you use it with some bootstrap.js, than some classes will be injected that will have been purged from the style sheets. E.g. I purged mine and found out the navbar dropdown wasn't working anymore.

So what should one do in this situation? Whitelist a bunch of classes or nut purge bootstrap at all? I solved the my issue by whitelisting the show class:

whitelistPatterns: [/show/]

Maybe one day we should do a check on which classes are being injected with bootstrap.js, and add an option to whitelist them. Because for me, most of my reduction comes from purging the bootstrap style sheets and perhaps for other too.

akrawchyk commented 5 years ago

Because if you use it with some bootstrap.js

you should add this bootstrap.js file to the paths in the plugin config, see https://www.purgecss.com/with-webpack#options