From 84a6c5d096909a4774728080bed422ff294517f0 Mon Sep 17 00:00:00 2001 From: Brad Cornes Date: Wed, 13 Oct 2021 19:58:58 +0100 Subject: [PATCH] Neaten `extract.DEFAULT` resolution (#5778) --- src/util/normalizeConfig.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/util/normalizeConfig.js b/src/util/normalizeConfig.js index 1921d84ee..e973c673f 100644 --- a/src/util/normalizeConfig.js +++ b/src/util/normalizeConfig.js @@ -170,7 +170,7 @@ export function normalizeConfig(config) { let extractors = {} - extractors.DEFAULT = (() => { + let defaultExtractor = (() => { if (config.purge?.options?.defaultExtractor) { return config.purge.options.defaultExtractor } @@ -182,6 +182,10 @@ export function normalizeConfig(config) { return undefined })() + if (defaultExtractor !== undefined) { + extractors.DEFAULT = defaultExtractor + } + // Functions if (typeof extract === 'function') { extractors.DEFAULT = extract