Closed chrisvidal closed 4 years ago
same error with this config
.purgeCss({
content: [
'./**/*.htm',
'./**/*.html',
'./**/*.vue',
'./**/*.jsx',
],
});
Same error. Also using tailwind.
Solved my problem by specifying the template folder in folders
.
It seems like the content
key isn't passed or overridden and you should use globs
and folders
config to set this.
Dear contributor,
because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.
Solved my problem by specifying the template folder in
folders
.
@KevinBeckers Hi,
I'm still dealing with some errors for this config. Can you provide an excerpt of your mix.config file?
Thank's.
Hello @damsfx,
This is what my purgeCss looks like:
.purgeCss({
enabled: true,
folders: ['./templates'],
extensions: ['.twig', 'twig', 'html']
}
Thank's @KevinBeckers ,
I've found a workaround this way :
/*
| Mix Asset Management
*/
mix
.setPublicPath('/')
.setResourceRoot('/themes/mytheme/')
.js(...)
.sass(...)
...
/*
| Purge
*/
if (mix.inProduction()) {
mix
.purgeCss({
content: [
'content/**/*.htm',
'layouts/**/*.htm',
'pages/**/*.htm',
'partials/**/*.htm',
],
extractors: [
{
extractor: content => content.match(/[A-Za-z0-9-_:/]+/g) || [],
// Specify the file extensions to include when scanning for class names.
extensions: ["html", "htm", "md", "js", "php", "vue"]
}
],
// To be adapted to your needs
whitelistPatterns: [
/-active$/,
/-enter$/,
/show$/,
/scrolled$/
]
})
}
My mix process include the two directives setPublicPath
and setResourceRoot
to specifiy where to work.
This combianisaon gives me correct results for the objective to be reached.
Context with tailwindcss laravel mix inside October CMS (A laravel CMS based)
not sure about what config should be applied: my feils are dispersed in different folder like layout, pages, partials, ...