Skip to content
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

Add Ability to Ignore Files/Folders #638

Merged
merged 9 commits into from Mar 14, 2021
Merged

Add Ability to Ignore Files/Folders #638

merged 9 commits into from Mar 14, 2021

Conversation

bdkjones
Copy link
Contributor

Proposed changes

This PR adds a new option: SkippedContentGlobs that allows users to tell PurgeCSS to NOT scan certain files/folders. The primary use-case is to avoid scanning node_modules and similar folders. The reason this option is needed is that glob (the dependency) dropped support for the old negation operator !.

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • [X ] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • [X ] Lint and unit tests pass locally with my changes
  • [X ] I have added tests that prove my fix is effective or that my feature works
  • [X ] I have added necessary documentation (if appropriate)

Further comments

The discussion can be found in #620

Note: This PR adds support for PurgeCSS itself and the PostCSS binding. It does not expose the option in all the other bindings because, well, I don't use them.

Note2: I'm not a TypeScript guy, so I highly suggest someone look over my work carefully and assume I've done stupid things.

Bryan Jones added 8 commits February 28, 2021 18:37
Adds support for the "ignore" option of the glob dependency to prevent PurgeCSS from scanning specific folders (such as node_modules, etc.)
Add description for new "skippedlist" option
Replaced "skiplist" with "skippedContentGlobs" and changed the type to Array<String>
Replaced "skiplist" with "skippedContentGlobs" and changed the type to Array<String>
test for "skippedContentGlobs" added, casing on 'string' type fixed. Test passes, but only with full path to file to skip right now.
# Conflicts:
#	packages/postcss-purgecss/src/types/index.ts
#	packages/purgecss/src/types/index.ts
Use the correct path for the test environment
Minor documentation tweaks
Ffloriel
Ffloriel previously approved these changes Mar 14, 2021
@Ffloriel Ffloriel merged commit 2a27663 into FullHuman:master Mar 14, 2021
@Ffloriel
Copy link
Member

Thanks @bdkjones

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants