Skip to content

Commit fcd76b5

Browse files
authored
Append base to hot file (#290)
1 parent 74ebc91 commit fcd76b5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ interface LaravelPlugin extends Plugin {
8484
config: (config: UserConfig, env: ConfigEnv) => UserConfig
8585
}
8686

87-
type DevServerUrl = `${'http'|'https'}://${string}:${number}`
87+
type DevServerUrl = `${'http'|'https'}://${string}:${number}${string}`
8888

8989
let exitHandlersBound = false
9090

@@ -431,8 +431,9 @@ function resolveDevServerUrl(address: AddressInfo, config: ResolvedConfig, userC
431431

432432
const configHmrClientPort = typeof config.server.hmr === 'object' ? config.server.hmr.clientPort : null
433433
const port = configHmrClientPort ?? address.port
434+
const base = config.base.replace(/\/$/, '')
434435

435-
return `${protocol}://${host}:${port}`
436+
return `${protocol}://${host}:${port}${base}`
436437
}
437438

438439
function isIpv6(address: AddressInfo): boolean {

0 commit comments

Comments
 (0)