Fixes external HMR (#1654)

This commit is contained in:
Matthew Phillips 2021-10-25 15:23:39 -04:00 committed by GitHub
parent 07f786096d
commit 0430c0e1d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -67628,7 +67628,9 @@ function clientInjectionsPlugin(config) {
return {
name: 'vite:client-inject',
transform(code, id) {
if (id === normalizedClientEntry || id === normalizedEnvEntry) {
if (id === normalizedClientEntry || id === normalizedEnvEntry ||
// Note that this is only needed for the Astro fork.
id.includes('astro_runtime_client_hmr')) {
let options = config.server.hmr;
options = options && typeof options !== 'boolean' ? options : {};
const host = options.host || null;