Skip to content

Commit

Permalink
Update hmr.ts
Browse files Browse the repository at this point in the history
This is to fix the bug that if the hmrPort != port, a server is not started on the hmrPort and HMR doesn't work
  • Loading branch information
xrgaddtt2 committed Feb 1, 2022
1 parent c44d86f commit cb76d4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion snowpack/src/dev/hmr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down

0 comments on commit cb76d4e

Please sign in to comment.