Skip to content

Commit

Permalink
fix(hmr): never invalidate an accepting importer (#2457)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson authored Mar 15, 2021
1 parent 6d5c9c6 commit 63bd250
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vite/src/node/server/hmr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,11 @@ function invalidate(mod: ModuleNode, timestamp: number, seen: Set<ModuleNode>) {
seen.add(mod)
mod.lastHMRTimestamp = timestamp
mod.transformResult = null
mod.importers.forEach((importer) => invalidate(importer, timestamp, seen))
mod.importers.forEach((importer) => {
if (!importer.acceptedHmrDeps.has(mod)) {
invalidate(importer, timestamp, seen)
}
})
}

export function handlePrunedModules(
Expand Down

0 comments on commit 63bd250

Please sign in to comment.