-
Notifications
You must be signed in to change notification settings - Fork 15
Purgecss stripping out 3rd party library styles #25
Comments
Hi, you can fix this by adding a whitelistPatterns: [/^mceu/] |
Thanks for that jsnanigans, Does that mean that i have to whitelist all 3rd party plugin elements that i am using as that would be a pretty huge list? When using PurifyCss in webpack 3 it was able to do this automatically though seems to have broken when upgrading to webpack 4. Isn't this the point of using something like Purgecss? to strip out unnecessary css from libraries like bootstrap? |
when using webpack you need to use The point of purgecss is to strip out So you only need to whitelist third party plugins that add html dynamically, like tinyMCE, if you are using a lightbox plugin that appends some html automatically youll have to add that too.. but for bootstrap, bulma, pure, foundation and most other ui kits you don't have to whitelist anything although you might have to use a special extractor for some. Hope that helps, let me know if you have any other issues :) |
Thanks very much for clearing that up for me jsnanigans, very much appreciated. |
FYI, the newest version 1.2.0 supports both webpack 4 and 3 so please, if you are on the next channel, install 1.2.0 |
I'd like to ask a question related to this issue. Since this is a webpack plugin, it could run after webpack has generated the final bundles. Those bundles certainly use tree shaking which guarantees that only the React components I effectively use are included. This would, in turn, allow us to extract keywords regardless of dependencies. But, to do this, purgecss should be able to take direct content as input ; as opposed to taking paths. What about that, does it seem feasible? Did I miss something? /cc @jsnanigans @Ffloriel |
When trying to use purgecss-webpack-plugin in my app it extracts all the css for any 3rd party plugin loaded such as jqueryui or tinyMCE. The page specific css is fine. My webpack config is :
I am using
webpack 4,
purgecss-webpack-plugin@1.0.2
Any ideas?
Many thanks
The text was updated successfully, but these errors were encountered: