DEV Community

Discussion on: The Right Way To Add Tailwind CSS to Gatsby with Purge CSS

Collapse
 
ricricucit profile image
Enrico Icardi

Thanks for this.
Question: is the "sizes" object also being Purged?

Collapse
 
changoman profile image
Hunter Chang

Great question, I'm actually not sure lol. I'd have to test that out when I get some time. If anyone else knows please enlighten us!

Collapse
 
kainmaligno profile image
Salvador Emmanuel

I use gatsby-plugin-purgecss to purge all

 {
      resolve: `gatsby-plugin-purgecss`,
      options: {
        printRejected: false,
        develop: false,
        tailwind: true,
      },
    },

and in to the tailwind.config.js use this

 purge: ["./components/**/*.{js,ts,jsx,tsx}", "./pages/**/*.{js,ts,jsx,tsx}"]