how to add purgeCSS for tailwind?
phrane opened this issue · comments
Excellent frontend-preset. Kudos!
Issue:
How do you include purgeCSS? The guide I'm following is
(https://medium.com/@wearethreebears/using-purgecss-to-remove-unused-tailwind-classes-with-laravel-mix-92dffba21ed7 ).
After npm install laravel-mix-purgecss --save-dev, is it correct to add purgeCss within webpack.mix.js "if" section... i.e.
if (mix.inProduction()) {
mix
.version()
//added in here?
.purgeCss({
enabled: mix.inProduction(),
folders: ['src', 'templates'],
extensions: ['html', 'js', 'php', 'vue'],
});
}
Actual
I see NO reduction on css size after running npm run prod
Expected
I would expect to see some size reduction
Okay, ignore this!
I've just realised purge is built-in tailwindcss, and configured via tailwind.config.js.