Skip to content

Commit

Permalink
fix(hmr): don't consider CSS dep as a circular dep (#15229)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Dec 4, 2023
1 parent 5efbaad commit 5f2cdec
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/vite/src/node/server/hmr.ts
Expand Up @@ -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) {
Expand Down

0 comments on commit 5f2cdec

Please sign in to comment.