Tailwind 3.x config: should the legacy purge key be kept or fully replaced by content
0 reputation · 02 Jan 2022, 17:31 UTC
In a Tailwind CSS 3.x project, the content array in tailwind.config.js controls which files are scanned so unused utilities are removed from the production build. Older guides and some starter templates still use the legacy purge key for the same purpose, and it is unclear whether both keys are honored, whether one silently overrides the other, or whether purge is simply aliased for backward compatibility.
The goal is to settle on one canonical configuration for a new project that must also stay understandable to teammates migrating from Tailwind 2.x setups. The concern is that a duplicated or deprecated key could mask misconfigured file paths, causing classes to be dropped from the production CSS without an obvious warning.
Assume Tailwind CSS 3.x with the default JIT compiler and a build run via the Tailwind CLI.
Does Tailwind 3.x treat purge as a deprecated alias of content, and what happens if both keys are present with different globs? Is there any documented scenario where keeping purge changes scanning behavior? Should new projects standardize on content only?