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

postcss not working after using vite: true #1282

Closed
medz opened this issue Aug 11, 2024 · 2 comments
Closed

postcss not working after using vite: true #1282

medz opened this issue Aug 11, 2024 · 2 comments

Comments

@medz
Copy link

medz commented Aug 11, 2024

Environment

  • Operating System: Darwin
  • Node Version: v22.6.0
  • Nuxt Version: 2.18.1
  • CLI Version: 3.12.0
  • Nitro Version: 2.9.7
  • Package Manager: npm@10.8.2
  • Builder: vite
  • User Config: bridge, vite, nitro, alias, routeRules, css, modules, head, plugins, components, buildModules, moment, axios, build, vue, router, serverHandlers, devServerHandlers, devServer, typescript
  • Runtime Modules: @nuxtjs/axios@5.13.6, @nuxtjs/tailwindcss@6.12.1
  • Build Modules: (), @nuxtjs/moment@1.6.1, @nuxt/bridge@3.3.1

Reproduction

https://stackblitz.com/~/github.com/medz/github-tvvdvm

Describe the bug

After using Vite, postcss no longer works, I just use @nuxtjs/tailwindcss package for simple demonstration.

Additional context

No response

Logs

No response

@medz
Copy link
Author

medz commented Aug 11, 2024

Fixed:

import tailwind from "tailwindcss";

export default defineNuxtConfig({
    bridge: { vite: true },
    vite: {
        css: {
             postcss: [tailwind()],
        }
    }
});

@medz medz closed this as completed Aug 11, 2024
@medz
Copy link
Author

medz commented Aug 11, 2024

This is not a very reasonable behavior. In Vite documents and other Nuxt documents, postcss is automatically executed, but in vite/tailwindcss or @nuxtjs/tailwindcss, it is not required to be configured.

But the actual situation is that any postcss plugin must be manually configured, otherwise it will not take effect.

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

1 participant