laravel-frontend-presets / tailwindcss

A Tailwind CSS frontend preset for the Laravel Framework

Home Page:https://laravel-frontend-presets.github.io/tailwindcss/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to add purgeCSS for tailwind?

phrane opened this issue · comments

commented

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

commented

Okay, ignore this!
I've just realised purge is built-in tailwindcss, and configured via tailwind.config.js.