2021-03-27

How tro Purge CSS with Wordpress, Tailwind and Gutenberg

I'm using Laravel Mix with Tailwind CSS included into a theme for Wordpress.

A part of my tailwind config:

 future: {
    removeDeprecatedGapUtilities: true,
    purgeLayersByDefault: true,
  },
  purge: {
    content: [
      '*.php',
      './*.php',
      './*/*.php',
      './purge-templates/*.html',
      './template-parts/*.php',
      './template-parts/**/*.php',
      './resources/*.css',
      './resources/**/*.css',
      './resources/*.js',
      './resources/**/*.js'
    ],
    options: {
      safelist: {
        standard: [/^has-/, /^align/, /^wp-/]
      }
    }
  },  

PurgeCss works fine for all files in the theme folder and in the paths I added but how do I get the classes I used in the content aka gutenberg blocks?
I got between 5-10 pages with content and every single one uses tailwind classes inside.

Do I need to save the content from each one into purge-templates or is there a way to do it automatically?

Thank you



from Recent Questions - Stack Overflow https://ift.tt/3suuSe1
https://ift.tt/eA8V8J

No comments:

Post a Comment