fix: disable HMR during build (#2684)

This commit is contained in:
Nate Moore 2022-03-01 08:13:39 -06:00 committed by GitHub
parent 4eb80773a7
commit c7bbb11289
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fix issue where HMR could be triggered during `astro build`

View file

@ -204,6 +204,7 @@ export default function astro({ config, logging }: AstroPluginOptions): vite.Plu
} }
}, },
async handleHotUpdate(context) { async handleHotUpdate(context) {
if (context.server.config.isProduction) return;
return handleHotUpdate(context, config, logging); return handleHotUpdate(context, config, logging);
}, },
}; };