Developmint / nuxt-purgecss

Drop superfluous CSS! A neat PurgeCSS wrapper for Nuxt.js
MIT License
478 stars 18 forks source link

regex doesn't work in the whitelist option #99

Closed ms-fadaei closed 3 years ago

ms-fadaei commented 3 years ago

When I use regex in the whitelist option, the PurgeCSS still removed those rules

whitelist:  [/^simplebar-.*$/],
ms-fadaei commented 3 years ago

I realize that I must use whitelistPatterns instead of whitelist

curtisbelt commented 3 years ago

I believe you have to use whitelistPatterns instead of whitelist in order to use regex. See the PurgeCSS 2.x docs for whistlisting patterns here: https://github.com/FullHuman/purgecss/blob/5314e41edf328e2ad2639549e1587b82a964a42e/docs/whitelisting.md#patterns

curtisbelt commented 3 years ago

Oh, you got it already! 😆