-
Notifications
You must be signed in to change notification settings - Fork 36
Removes classes used in node_module react plugin #118
Comments
@jmahc is it correct that the link goes to a github page? :) |
@chacestew you need to whitelist the (react) modules you are using:
|
Thanks @IgnusG - Is this the only way to parse node modules? Using Regarding the whitelist, we've had to move to PurgeCSS for the regex patterns so that we could properly whitelist classes with uppercase letters. |
@chacestew unfortunately I’m unfamiliar with either of your use-cases ^^' What are you using |
I was hoping there was an easier way to make purifycss also recursively parse all imported React libraries. Whitelisting all the styles for each library adds manual steps and means none of those styles will be optimised. From the documentation this seemed like a benefit purifycss brought, but we haven't had it work correctly yet (seems to preserve only a random subset of the class names used by them). Regarding the whitelist patterns, it is actually coercing them to lowercase but not doing the same at the comparison step, so it's impossible to match on camelCase: purifycss/purifycss#145. There was a fix committed about a year ago but never merged. We've found the regex patterns of purgecss to handle this better. Admittedly, these are all issues with purifycss and not the webpack plugin, so we can't resolve them here but it's worth making the info available. |
Everything works great except for the fact that it removes classes which are used in a
node_modules
plugins.My config
Plugins
The plugins it removes the styling for are
react-select
andreact-day-picker
. None of the classnames used in these plugins are kept when usingpurifycss-webpack
, which is not the desired case ofcourse.Any ideas on how to solve this?
The text was updated successfully, but these errors were encountered: