webpack-contrib / purifycss-webpack

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

Enhancement - Scan javascript chunk output for classnames #116

Open james-s-turner opened 7 years ago

james-s-turner commented 7 years ago

I have a number of react apps that use a shared component library. Each app uses a different subset of the shared library. In each apps webpack config I have to hardcode the paths of the shared components the app uses. Effectively I am duplicating the work that webpack does navigating the dependency tree. Would it be possible to scan the output from webpack (effectively the emitted js chunks) for classnames rather than configuring the paths?

zekida commented 7 years ago

i actually think this should be the default behavior with an option to disable it. it would free users from extra work to add globs for UI framework dependencies, and would probably be the most 'general use case' of this plugin.. or am I missing something? it should work very nicely with properly tree-shaken chunks too.