Skip to content
This repository was archived by the owner on Feb 1, 2020. It is now read-only.

Function for path to evaluate on each compilation #10

Merged
merged 2 commits into from
Jan 5, 2018
Merged

Function for path to evaluate on each compilation #10

merged 2 commits into from
Jan 5, 2018

Conversation

SebastianS90
Copy link
Contributor

Proposed changes

Assume you run webpack --watch and have some glob pattern specified as paths for purgecss-webpack-plugin. Now you add some files that match the specified glob pattern and require them from existing files. Webpack happily detects the change in existing files and recompiles, thereby also including the new files we just added.

But purgecss does not yet know about those new files and might strip some selectors that are now in use.

My change allows to pass a function as paths. The function will be evaluated on each compilation, therefore catching all new files in the next --watch run.

Similarily, I added function support for whitelist and whitelistPatterns. This is useful in conjunction with purgecss-whitelister.

Types of changes

What types of changes does your code introduce to purgecss-webpack-plugin?

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

Checklist

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

@Ffloriel Ffloriel self-requested a review January 2, 2018 23:21
@Ffloriel Ffloriel merged commit c9aaf06 into FullHuman:master Jan 5, 2018
@Ffloriel
Copy link
Member

Ffloriel commented Jan 5, 2018

LGTM
Thanks for the PR.

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

Successfully merging this pull request may close these issues.

2 participants