From cb76d4ef0c1f5439bad9b02e19e1eefc40086cad Mon Sep 17 00:00:00 2001 From: xrgaddtt2 <79239332+xrgaddtt2@users.noreply.github.com> Date: Tue, 1 Feb 2022 12:32:44 +1100 Subject: [PATCH] Update hmr.ts This is to fix the bug that if the hmrPort != port, a server is not started on the hmrPort and HMR doesn't work --- snowpack/src/dev/hmr.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snowpack/src/dev/hmr.ts b/snowpack/src/dev/hmr.ts index 62955743f0..51da1efefa 100644 --- a/snowpack/src/dev/hmr.ts +++ b/snowpack/src/dev/hmr.ts @@ -15,7 +15,7 @@ export function startHmrEngine( ) { const {hmrDelay} = config.devOptions; const hmrPort = config.devOptions.hmrPort || serverPort; - const hmrEngine = new EsmHmrEngine({server, port: hmrPort, delay: hmrDelay}); + const hmrEngine = new EsmHmrEngine({server: (hmrPort == serverPort ? server : null) , port: hmrPort, delay: hmrDelay}); onProcessExit(() => { hmrEngine.disconnectAllClients(); });