fix(hmr): don't mutate module graph when collecting modules (#16302)

This commit is contained in:
翠 / green 2024-03-29 13:51:38 +09:00 committed by GitHub
parent 1f5379601e
commit dfffea1f43
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -162,7 +162,7 @@ export async function handleHMRUpdate(
return
}
const mods = moduleGraph.getModulesByFile(file) || new Set()
const mods = new Set(moduleGraph.getModulesByFile(file))
if (type === 'create' || type === 'delete') {
for (const mod of getAffectedGlobModules(file, server)) {
mods.add(mod)