Skip to content

[v4] Tailwind utilities layer absent in production build when vite.build.minify is used #15278

@vejja

Description

@vejja

What version of Tailwind CSS are you using?

v4

What build tool (or framework if it abstracts the build tool) are you using?

Nuxt (Vite)

What version of Node.js are you using?

20

What browser are you using?

Chrome

What operating system are you using?

macOS

Reproduction URL

https://github.com/siyosu/nuxt-ui-v3
https://nuxt-ui-v3.vercel.app/

Describe your issue

The Tailwind utilities layer is absent in the reproduction.
Observe how the class space-y-4 is not applied between the email input and the login button.

Please see details in full issue as originally posted here : Baroshem/nuxt-security#576

This is Nuxt Security team.
Our context is the Nuxt Framework, but the issue appears to be unrelated to Nuxt.
Our investigation found that the bug only appears when Vite is used with option { build: { minify: true } } as documented in Vite here : https://vite.dev/config/build-options#build-minify

As a temporary workaround, we are disabling Vite's build minification.
However we would like to be able to minify builds again. This breaks Tailwind for now.

Metadata

Metadata

Assignees

Labels

upstreamIssues that need to be fixed in upstream providers (e.g. lightningcss, vite, `@parcel/watcher`).

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions