diff --git a/.changeset/wet-knives-raise.md b/.changeset/wet-knives-raise.md new file mode 100644 index 000000000..9a0b1acc2 --- /dev/null +++ b/.changeset/wet-knives-raise.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix issue where HMR could be triggered during `astro build` diff --git a/packages/astro/src/vite-plugin-astro/index.ts b/packages/astro/src/vite-plugin-astro/index.ts index 3165c8786..4b74e1060 100644 --- a/packages/astro/src/vite-plugin-astro/index.ts +++ b/packages/astro/src/vite-plugin-astro/index.ts @@ -204,6 +204,7 @@ export default function astro({ config, logging }: AstroPluginOptions): vite.Plu } }, async handleHotUpdate(context) { + if (context.server.config.isProduction) return; return handleHotUpdate(context, config, logging); }, };