This repository has been archived by the owner on Feb 1, 2020. It is now read-only.
Add rejected
functionality, and update readme with Usage example.
#19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When its
rejected
option is set,purgecss
makes available the list of removed selectors.This PR defines
gulp-purgecss
's response to that same option. When therejected
option is set, the plugin outputs a list of the removed selectors, rather than the default output.It's extremely useful for the developer to sanity-check the list of rejected selectors, both to aid in identifying obsolete CSS that could be pruned from source files, and to discover any dynamically generated selector patterns that need to be whitelisted.
Importantly, this "inverted" output is still valid CSS: The list is formatted with empty declaration blocks for each selector in the list, so it will not cause errors when used as part of a Gulp process that still expects
gulp-purgecss
to output valid CSS (such as the new example provided in the README):Types of changes
Checklist
(p.s. This feature was also requested for the
postcss-purgecss
plugin. I'll be happy to PR it there also, if you approve.)