DEV Community

Discussion on: How to set up Ruby on Rails 6 and TailwindCSS 1.1.4

Collapse
 
pavelloz profile image
Paweł Kowalski • Edited

NEVER, ever use Tailwindcss without purgeCSS to clean it up on production. Otherwise you will be shipping 780KB of css (in 2.0 this will be probably over 1MB, and rapidly growing with plugins and customizations), from which you will be using 1% of it.

Those couple lines of code in postcss config is why Tailwind is so great in the performance department.

Example config: github.com/pavelloz/webpack-tailwi...
Official docs explanation: tailwindcss.com/docs/controlling-f...

Collapse
 
rossta profile image
Ross Kaffenberger

Good callout. It can be easy to miss this concern when first getting started with TailwindCSS.

Collapse
 
andrewmcodes profile image
Andrew Mason

This is a great point. I will be doing a follow up to this for adding purgecss.