🗜 How I purged 95% of unused CSS from my Gatsby website
Published On: Feb 21 '20

I was using bootstrap for a long time. The last project I used bootstrap is the website I made with Gatsby.

But most of the time, I use only the responsive classes in bootstrap. The bootstrap.css file itself is 152 kb in size. I had to find a way to remove unnecessary CSS from the code. I was using bootstrap from the first version of this website. I didn't want to change.

So, I used gatsby-plugin-purgecss to remove unnecessary CSS from the production build.

Build Screenshot

Even though this is NOT an install and forgets type plugin (mentioned in their documentation), for my website, adding to the gatsby-config.js file did a good job.