diff options
author | 2022-02-03 16:41:48 -0500 | |
---|---|---|
committer | 2022-02-03 16:41:48 -0500 | |
commit | b210fd008b9253f0c755c21e157cd7fb069c8445 (patch) | |
tree | 40cce91c58cedab478a4716b61a36f6ae6c6aea3 | |
parent | ef1d81effd4e0c420c6eb2e5e500cfaac3106ea8 (diff) | |
download | astro-b210fd008b9253f0c755c21e157cd7fb069c8445.tar.gz astro-b210fd008b9253f0c755c21e157cd7fb069c8445.tar.zst astro-b210fd008b9253f0c755c21e157cd7fb069c8445.zip |
Append to list of HMR modules, don't override (#2532)
* Append to list of HMR modules, don't override
* Changeset
-rw-r--r-- | .changeset/four-mirrors-wonder.md | 5 | ||||
-rw-r--r-- | packages/astro/src/vite-plugin-astro/hmr.ts | 2 |
2 files changed, 6 insertions, 1 deletions
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<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)) { |