-
-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output unused css #131
Comments
I was rethinking the whole idea. If you can get an array of classnames which was rejected. Maybe if there would be some kind of configuration like 'ignore: [array]' so scanned classes would be automatically ignored and not included in purged file |
I think both options would be a good Idea, one would be to take all the css that gets purged and optionally output a seperate css file with all of those. Your second suggestion would be to "blacklist" some styles so that they get purged even if the extractor finds something that would match it right? |
I approve this request. |
I would really like this feature too, but for the purpose of cleaning up the original scss files. Output to the terminal or a file would allow me to delete classes or add to a whitelist until there was nothing left to be purged. |
+1 |
There already is the |
Same here with Gulp. Don't know what should I do after setting |
Same here, |
the option |
I would also like to see this, the unused CSS output to another file. Is that feature available yet? Last update here was almost a year ago. What does it mean this is available in the node API. How do I use that? I am using Gulp. Thank you |
+1 |
+1 for gulp please |
|
+1 |
2 similar comments
+1 |
+1 |
+1 .. this sounds essential to be fully aware that the selectors removed are not needed. I need it to be sure I have whitelisted needed classes and it would be good to have a reference to go back and remove my own unused css directly. |
I'm confused by this page https://purgecss.com/plugins/gulp.html#usage, it suggest that you can output rejected CSS, but it doesn't seem to work. I found that you need a postcss-reporter to even get the rejected css to appear in the console, but what I want is the rejected css added to a .css file. Doesn't appear to do anything with rejected CSS, at least not in console or rendered file...
Adding a reporter, I at least get it back in the console...
The docs claim the following. I haven't tried with rename. Could that be the key?
|
I implemented this feature, its available on my fork https://github.com/kevinramharak/purgecss/tree/output-unused-css. It has an open PR at #763 . |
Is your feature request related to a problem? Please describe.
Yes, I want to create SSR html file with inline purged CSS but afterwards lazily load leftovers of css
Describe the solution you'd like
I want purgecss to output css that was excluded from output file ( original css without purged css)
Describe alternatives you've considered
Find a multi platform reverse diff solution, but haven't found one
The text was updated successfully, but these errors were encountered: