From b210fd008b9253f0c755c21e157cd7fb069c8445 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Thu, 3 Feb 2022 16:41:48 -0500 Subject: [PATCH] Append to list of HMR modules, don't override (#2532) * Append to list of HMR modules, don't override * Changeset --- .changeset/four-mirrors-wonder.md | 5 +++++ packages/astro/src/vite-plugin-astro/hmr.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/four-mirrors-wonder.md diff --git a/.changeset/four-mirrors-wonder.md b/.changeset/four-mirrors-wonder.md new file mode 100644 index 000000000..901fbf523 --- /dev/null +++ b/.changeset/four-mirrors-wonder.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fixes HMR of .astro modules in astro@next diff --git a/packages/astro/src/vite-plugin-astro/hmr.ts b/packages/astro/src/vite-plugin-astro/hmr.ts index 84f06cda5..12bf274d0 100644 --- a/packages/astro/src/vite-plugin-astro/hmr.ts +++ b/packages/astro/src/vite-plugin-astro/hmr.ts @@ -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(); + const filtered = new Set(ctx.modules); const files = new Set(); for (const mod of ctx.modules) { if (mod.file && isCached(config, mod.file)) {