tailwindcss@2.1.3 will cause every single file in the project to be watched
See original GitHub issueVersion
@nuxtjs/tailwindcss: 4.1.3 nuxt: 2.15.6 tailwind: >=2.1.3
Reproduction Link
No reproduction link but here’s the tailwindcss PR that causes the problem: https://github.com/tailwindlabs/tailwindcss/pull/4530
Steps to reproduce
Install a new project with @nuxtjs/tailwindcss and tailwindcss@2.1.3 or higher.
What is Expected?
Only the relevant project files are being watched and trigger a nuxt rebuild.
What is actually happening?
Any file in the project, including node modules, markdown files, github workflows, IDE specific files, anything is being watched and trigger a nuxt rebuild.
I think it comes from the new behaviour brought by this PR: https://github.com/tailwindlabs/tailwindcss/pull/4530
This PR added a new “glob check” on paths provided to purge CSS. If the path is a glob, it will watch the directory instead.
Which is fine for these paths:
`${srcDir}/components/**/*.{vue,js,ts}`,
`${srcDir}/layouts/**/*.vue`,
`${srcDir}/pages/**/*.vue`,
`${srcDir}/plugins/**/*.{js,ts}`,
But this one is causing the issue:
`${rootDir}/nuxt.config.{js,ts}`
Tailwind will now consider this a glob and thus push the entire rootDir
to be watched.
A potential quick fix for this would be to explicitly watch Javascript and Typescript config separately, to avoid tailwind thinking it must watch the whole directory:
`${rootDir}/nuxt.config.js`,
`${rootDir}/nuxt.config.ts`
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:22
Top GitHub Comments
Yep just wanted to add another report so the regression can get fixed.
For posterity (and so it can be easily copied), this is what needs to be added to
nuxt.config.js
@creazy231 I did this in my nuxt.config.js: