Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(hmr): entry mod's importers contains css mod invalidate hmr #3929

Merged
merged 2 commits into from
Jun 28, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(hmr): entry mod's importers contains css mod invalidate hmr
  • Loading branch information
y1d7ng committed Jun 24, 2021
commit e5108b87b25efd577f2030fdd2e889d9648df7e1
10 changes: 9 additions & 1 deletion packages/vite/src/node/server/hmr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,15 @@ function propagateUpdate(
return true
}

const isNotCSSMod = !isCSSRequest(node.url)
let noImporter = true

for (const importer of node.importers) {
if (isCSSRequest(importer.url) && isNotCSSMod) {
continue
}
noImporter = false

const subChain = currentChain.concat(importer)
if (importer.acceptedHmrDeps.has(node)) {
boundaries.add({
Expand All @@ -263,7 +271,7 @@ function propagateUpdate(
return true
}
}
return false
return noImporter
}

function invalidate(mod: ModuleNode, timestamp: number, seen: Set<ModuleNode>) {
Expand Down