From 0148cea584f9a09c26846b505dbb4945b4c1b536 Mon Sep 17 00:00:00 2001 From: Nelson Reis Date: Sun, 21 Feb 2021 10:35:50 +0000 Subject: [PATCH] feat: add option blocklist to webpack plugin (#610) --- packages/purgecss-webpack-plugin/src/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/purgecss-webpack-plugin/src/index.ts b/packages/purgecss-webpack-plugin/src/index.ts index e1c7b9ad..a77ae101 100644 --- a/packages/purgecss-webpack-plugin/src/index.ts +++ b/packages/purgecss-webpack-plugin/src/index.ts @@ -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, @@ -114,6 +118,7 @@ export default class PurgeCSSPlugin { rejected: options.rejected, variables: options.variables, safelist: options.safelist, + blocklist: options.blocklist, }); const purged = purgecss[0];