Append to list of HMR modules, don't override (#2532)

* Append to list of HMR modules, don't override

* Changeset
This commit is contained in:
Matthew Phillips 2022-02-03 16:41:48 -05:00 committed by GitHub
parent ef1d81effd
commit b210fd008b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fixes HMR of .astro modules in astro@next

View file

@ -49,7 +49,7 @@ export function handleHotUpdate(ctx: HmrContext, config: AstroConfig) {
// go through each of these modules importers and invalidate any .astro compilation
// that needs to be rerun.
const filtered = new Set<ModuleNode>();
const filtered = new Set<ModuleNode>(ctx.modules);
const files = new Set<string>();
for (const mod of ctx.modules) {
if (mod.file && isCached(config, mod.file)) {