diff --git a/packages/vite/src/node/server/hmr.ts b/packages/vite/src/node/server/hmr.ts index 45ba8d5344081f..7f1620ee4f8070 100644 --- a/packages/vite/src/node/server/hmr.ts +++ b/packages/vite/src/node/server/hmr.ts @@ -394,6 +394,11 @@ function isNodeWithinCircularImports( // Node may import itself which is safe if (importer === node) continue + // a PostCSS plugin like Tailwind JIT may register + // any file as a dependency to a CSS file. + // But in that case, the actual dependency chain is separate. + if (isCSSRequest(importer.url)) continue + // Check circular imports const importerIndex = nodeChain.indexOf(importer) if (importerIndex > -1) {