Skip to content

Commit 05e4cee

Browse files
authored
Ensure purge.options.safelist is taken into account (#5356)
Also fixed a small typo 🤫
1 parent 691ed02 commit 05e4cee

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/util/resolveConfig.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,11 @@ function normalizeConfig(config) {
312312
safelist: (() => {
313313
let { content, purge } = config
314314

315-
let [safelisKey, safelistPaths] = (() => {
315+
let [safelistKey, safelistPaths] = (() => {
316316
if (Array.isArray(content?.safelist)) return ['content.safelist', content.safelist]
317317
if (Array.isArray(purge?.safelist)) return ['purge.safelist', purge.safelist]
318+
if (Array.isArray(purge?.options?.safelist))
319+
return ['purge.options.safelist', purge.options.safelist]
318320
return [null, []]
319321
})()
320322

@@ -330,7 +332,7 @@ function normalizeConfig(config) {
330332
}
331333

332334
throw new Error(
333-
`Values inside '${safelisKey}' can only be of type 'string', found '${typeof content}'.`
335+
`Values inside '${safelistKey}' can only be of type 'string', found '${typeof content}'.`
334336
)
335337
})
336338
})(),

0 commit comments

Comments
 (0)