Skip to content

Issue with TailwindCSS JIT (Just-In-Time) Mode Not Purging Unused Styles in Production Build #144696

Answered by wlb-tycoon
edgehue asked this question in Pages
Discussion options

You must be logged in to vote

Hi! It seems like your tailwind.config.js file is mostly set up correctly, but there might be a couple of things to check to ensure JIT mode and purging are working as expected in production.

  1. Check TailwindCSS Version: First, ensure you're using TailwindCSS v2.1 or later. JIT mode is built-in starting from v2.1, but if you're using an older version, you may need to manually enable JIT mode or upgrade Tailwind to the latest version.

You can check the version by running:

npm list tailwindcss

If you need to upgrade:

npm install tailwindcss@latest
  1. Ensure Correct Purge Configuration: Starting with Tailwind v3.x, the purge option was replaced by the content key, which you've already set. T…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by edgehue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pages Host a static website, right from your repo Question
2 participants