thebigk's avatar
Level 13

Laravel 8 and TailwindCSS Purge Option

Can someone show me how to use the TailwindCSS purge option; available in the tailwind.config.js file, along with laravel mix so that I can minimize the CSS file size?

module.exports = {
  purge: [],
  theme: {
    extend: {},
  },
  variants: {},
  plugins: [
    require('@tailwindcss/ui'),
  ],
}

What path should I specify in purge: [] ?

0 likes
1 reply
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

Put this in your tailwind config (change file ending if you are using others)

purge: {
    content: [
      './resources/**/*.blade.php',
      './resources/**/*.js',
      './resources/**/*.vue',
    ],
  },
1 like

Please or to participate in this conversation.