From 93e431967fa7c1ac71ccb64e064f10b1397de494 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Thu, 31 Mar 2022 12:58:49 -0500 Subject: [PATCH] chore: add code comment --- packages/astro/src/vite-plugin-astro/hmr.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/astro/src/vite-plugin-astro/hmr.ts b/packages/astro/src/vite-plugin-astro/hmr.ts index fbc52262a..c51047cd7 100644 --- a/packages/astro/src/vite-plugin-astro/hmr.ts +++ b/packages/astro/src/vite-plugin-astro/hmr.ts @@ -81,6 +81,9 @@ export async function handleHotUpdate(ctx: HmrContext, config: AstroConfig, logg const mod = ctx.modules.find((m) => m.file === ctx.file); const file = ctx.file.replace(config.projectRoot.pathname, '/'); + + // Note: this intentionally ONLY applies to Astro components + // HMR is handled for other file types by their respective plugins if (ctx.file.endsWith('.astro')) { ctx.server.ws.send({ type: 'custom', event: 'astro:update', data: { file } }); }