Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v4] including @tailwindcss/vite in plugins breaks css modules in production #15147

Open
abhishiv opened this issue Nov 23, 2024 · 2 comments
Open

Comments

@abhishiv
Copy link

abhishiv commented Nov 23, 2024

What version of Tailwind CSS are you using?

4.0.0-beta.1

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

@tailwindcss/[email protected] with [email protected]

What version of Node.js are you using?

v20.5.0

What browser are you using?

Chrome

What operating system are you using?

macOS

Describe your issue

Following vite.config.js makes vite generate incorrect css class name for css modules

  plugins: [tailwindcss()],
  css: {
    postcss: {},
    modules: {
      generateScopedName: "[local]__[hash:base64:5]",
    },
  },

Maybe related, but I see following error in production


[plugin @tailwindcss/vite:generate:build] Sourcemap is likely to be incorrect: a plugin (@tailwindcss/vite:generate:build) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
@abhishiv abhishiv changed the title ] [v4] @tailwindcss/vite breaks css modules Nov 23, 2024
@abhishiv abhishiv changed the title [v4] @tailwindcss/vite breaks css modules [v4] including @tailwindcss/vite in plugins breaks css modules in production Nov 23, 2024
@philipp-spiess
Copy link
Member

Hey @abhishiv! Thanks for the report. Do you mind uploading a reproduction repository for us to check out? I was just testing your config in our Vite playground and it seems to work as expected for both dev and production builds:

Screenshot 2024-11-25 at 10 43 07

@Alma219Way

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants