Skip to content

Commit 6ed250d

Browse files
authored
Merge pull request #63 from guilheb/main
Use HMR port when specified
2 parents 53f8f4e + 7eda94c commit 6ed250d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,11 @@ function resolveDevServerUrl(address: AddressInfo, config: ResolvedConfig): DevS
341341
const configHost = typeof config.server.host === 'string' ? config.server.host : null
342342
const serverAddress = address.family === 'IPv6' ? `[${address.address}]` : address.address
343343
const host = configHmrHost ?? configHost ?? serverAddress
344+
345+
const configHmrClientPort = typeof config.server.hmr === 'object' ? config.server.hmr.clientPort : null
346+
const port = configHmrClientPort ?? address.port
344347

345-
return `${protocol}://${host}:${address.port}`
348+
return `${protocol}://${host}:${port}`
346349
}
347350

348351
/**

0 commit comments

Comments
 (0)