mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Ensure purge.options.safelist is taken into account (#5356)
Also fixed a small typo 🤫
This commit is contained in:
parent
691ed02f63
commit
05e4ceee5b
@ -312,9 +312,11 @@ function normalizeConfig(config) {
|
||||
safelist: (() => {
|
||||
let { content, purge } = config
|
||||
|
||||
let [safelisKey, safelistPaths] = (() => {
|
||||
let [safelistKey, safelistPaths] = (() => {
|
||||
if (Array.isArray(content?.safelist)) return ['content.safelist', content.safelist]
|
||||
if (Array.isArray(purge?.safelist)) return ['purge.safelist', purge.safelist]
|
||||
if (Array.isArray(purge?.options?.safelist))
|
||||
return ['purge.options.safelist', purge.options.safelist]
|
||||
return [null, []]
|
||||
})()
|
||||
|
||||
@ -330,7 +332,7 @@ function normalizeConfig(config) {
|
||||
}
|
||||
|
||||
throw new Error(
|
||||
`Values inside '${safelisKey}' can only be of type 'string', found '${typeof content}'.`
|
||||
`Values inside '${safelistKey}' can only be of type 'string', found '${typeof content}'.`
|
||||
)
|
||||
})
|
||||
})(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user