This repository demonstrates a common issue encountered when using Tailwind CSS's JIT mode with frameworks that generate dynamic class names client-side. The problem is that unused styles, dynamically added, aren't purged during the production build, leading to larger bundle sizes and slower load times.
npm install
npm run dev
npm run build
The solution involves carefully managing how dynamic classes are generated and ensuring that Tailwind can correctly identify and purge them. The solution may involve using a whitelist for specific dynamic classes, customizing your PurgeCSS configuration, or refactoring your component structure to generate fewer dynamic classes. More details are provided in bugSolution.js
.