Skip to content

Commit

Permalink
feat: add option blocklist to webpack plugin (#610)
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonReis authored Feb 21, 2021
1 parent 824e208 commit 0148cea
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/purgecss-webpack-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ export default class PurgeCSSPlugin {
if (typeof options.safelist === "function") {
options.safelist = options.safelist();
}

if (typeof options.blocklist === "function") {
options.blocklist = options.blocklist();
}

const purgecss = await new PurgeCSS().purge({
content: options.content,
Expand All @@ -114,6 +118,7 @@ export default class PurgeCSSPlugin {
rejected: options.rejected,
variables: options.variables,
safelist: options.safelist,
blocklist: options.blocklist,
});
const purged = purgecss[0];

Expand Down

0 comments on commit 0148cea

Please sign in to comment.