In a project structure where I have this:
I specified this in the config folders: ['source'].
How do I configure the plugin to NOT scan for words in the bar directory?
The options for purgecss look like this:
{
content: Array<string | RawContent>,
css: Array<string | RawContent>,
extractors?: Array<ExtractorsObj>,
whitelist?: Array<string>,
whitelistPatterns?: Array<RegExp>,
whitelistPatternsChildren?: Array<RegExp>,
keyframes?: boolean,
fontFace?: boolean,
rejected?: boolean
}
As you can see there is no option called folders.
If you want to scan all the content inside a given folder you need to pass a glob to the content option.
Here is an example:
content: [
// keep only those that you need
'**/*.html' // will look inside any folder for an .html file
'!(bar)/**/*.html' // will look inside any folder that is not 'bar'
'!({bar,foo})/**/*.html' // will look inside any folder that is nor 'bar' nor 'foo'
'!(bar-*)/**/*.html' // will look inside any folder that does not start with 'bar-'
],
css: [`**/*.css`],
Most helpful comment
The options for purgecss look like this:
As you can see there is no option called
folders.If you want to scan all the content inside a given folder you need to pass a glob to the
contentoption.Here is an example: