Skip to content

Commit 4e4b205

Browse files
authored
Update index.ts
Use hmr.port when specified
1 parent 511ee49 commit 4e4b205

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,10 @@ function resolveDevServerUrl(address: AddressInfo, config: ResolvedConfig): DevS
400400
const configHost = typeof config.server.host === 'string' ? config.server.host : null
401401
const serverAddress = address.family === 'IPv6' ? `[${address.address}]` : address.address
402402
const host = configHmrHost ?? configHost ?? serverAddress
403+
404+
const port = typeof config.server.hmr === 'object' ? (config.server.hmr.port ?? address.port)
403405

404-
return `${protocol}://${host}:${address.port}`
406+
return `${protocol}://${host}:${port}`
405407
}
406408

407409
/**

0 commit comments

Comments
 (0)