From 9ccdf87576f660d5b593e0b473b78ce46583cb5d Mon Sep 17 00:00:00 2001 From: Philipp Spiess Date: Fri, 30 Aug 2024 12:22:51 +0200 Subject: [PATCH] Adding watch files in renderStart doesn't make sense --- packages/@tailwindcss-vite/src/index.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/@tailwindcss-vite/src/index.ts b/packages/@tailwindcss-vite/src/index.ts index 688b1cdcf..56555cfba 100644 --- a/packages/@tailwindcss-vite/src/index.ts +++ b/packages/@tailwindcss-vite/src/index.ts @@ -419,7 +419,15 @@ export default function tailwindcss(): Plugin[] { // by vite:css-post. async renderStart() { for (let [id, root] of roots.entries()) { - let generated = await regenerateOptimizedCss(root, (file) => this.addWatchFile(file)) + let generated = await regenerateOptimizedCss( + root, + // During the renderStart phase, we can not add watch files since + // those would not be causing a refresh of the right CSS file. This + // should not be an issue since we did already process the CSS file + // before and the dependencies should not be changed (only the + // candidate list might have) + () => {}, + ) if (!generated) { roots.delete(id) continue