-
Notifications
You must be signed in to change notification settings - Fork 195
Description
Version
@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: tailwindlabs/tailwindcss#4530
Steps to reproduce
Install a new project with @nuxtjs/tailwindcss and [email protected] 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: tailwindlabs/tailwindcss#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`