Skip to content

Commit 5f2cdec

Browse files
authored
fix(hmr): don't consider CSS dep as a circular dep (#15229)
1 parent 5efbaad commit 5f2cdec

File tree

1 file changed

+5
-0
lines changed
  • packages/vite/src/node/server

1 file changed

+5
-0
lines changed

packages/vite/src/node/server/hmr.ts

+5
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,11 @@ function isNodeWithinCircularImports(
394394
// Node may import itself which is safe
395395
if (importer === node) continue
396396

397+
// a PostCSS plugin like Tailwind JIT may register
398+
// any file as a dependency to a CSS file.
399+
// But in that case, the actual dependency chain is separate.
400+
if (isCSSRequest(importer.url)) continue
401+
397402
// Check circular imports
398403
const importerIndex = nodeChain.indexOf(importer)
399404
if (importerIndex > -1) {

0 commit comments

Comments
 (0)