Closed rtm619 closed 6 years ago
I published a new version 3.0.0 of next-purgecss, so you can try with the latest purgecss-webpack-plugin
version.
If the issue is still there, it's probably an issue with purgecss (maybe this : https://github.com/FullHuman/purgecss/issues/95). This plugin only passes configuration down to purgecss-webpack-plugin
and purgecss
.
Just to save some time for future googlers – if your purgeCssPaths
is too generic (with wildcards) and the path contains files with extensions not specified in extractors.extensions
, you'll get TypeError: Cannot read property 'extractor' of undefined
.
You either have to include all extensions existing in your path or narrow the path.
purgeCssPaths: [
// Only classes present in following files will make it to the final build
'src/**/*.js',
'src/**/*.jsx',
'src/**/*.ts',
'src/**/*.tsx',
'src/**/*.svg',
'src/**/*.html',
],
purgeCss: {
extractors: [
{
extractor: TailwindExtractor,
extensions: ['js', 'jsx', 'ts', 'tsx', 'svg', 'html'],
},
],
}
Hi,
When I'm trying to use a custom extractor with purgecss, its throwing this error:
My next.config.js
I noticed that the purgecss-webpack-plugin is outdated. Is that why I can't use extractors? My next-purgecss version is 2.0.0