diff options
-rw-r--r-- | packages/astro/src/vite-plugin-astro/hmr.ts | 16 | ||||
-rw-r--r-- | packages/astro/src/vite-plugin-astro/index.ts | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/packages/astro/src/vite-plugin-astro/hmr.ts b/packages/astro/src/vite-plugin-astro/hmr.ts index e307166db..c218998fa 100644 --- a/packages/astro/src/vite-plugin-astro/hmr.ts +++ b/packages/astro/src/vite-plugin-astro/hmr.ts @@ -150,14 +150,14 @@ export async function handleHotUpdate( // If this is a module that is imported from a <script>, invalidate the Astro // component so that it is cached by the time the script gets transformed. - for(const mod of filtered) { - if(mod.id && isAstroScript(mod.id) && mod.file) { - const astroMod = ctx.server.moduleGraph.getModuleById(mod.file); - if(astroMod) { - mods.unshift(astroMod); - } - } - } + for (const mod of filtered) { + if (mod.id && isAstroScript(mod.id) && mod.file) { + const astroMod = ctx.server.moduleGraph.getModuleById(mod.file); + if (astroMod) { + mods.unshift(astroMod); + } + } + } // TODO: Svelte files should be marked as `isSelfAccepting` but they don't appear to be const isSelfAccepting = mods.every((m) => m.isSelfAccepting || m.url.endsWith('.svelte')); diff --git a/packages/astro/src/vite-plugin-astro/index.ts b/packages/astro/src/vite-plugin-astro/index.ts index 2e5eb54ff..393128803 100644 --- a/packages/astro/src/vite-plugin-astro/index.ts +++ b/packages/astro/src/vite-plugin-astro/index.ts @@ -362,7 +362,7 @@ ${source} return handleHotUpdate.call(this, context, { config, logging, - compile + compile, }); }, }; |