@@ -84,7 +84,7 @@ interface LaravelPlugin extends Plugin {
8484 config : ( config : UserConfig , env : ConfigEnv ) => UserConfig
8585}
8686
87- type DevServerUrl = `${'http' | 'https' } ://${string } :${number } ${ string } `
87+ type DevServerUrl = `${'http' | 'https' } ://${string } :${number } `
8888
8989let exitHandlersBound = false
9090
@@ -204,7 +204,8 @@ function resolveLaravelPlugin(pluginConfig: Required<PluginConfig>): LaravelPlug
204204 const isAddressInfo = ( x : string | AddressInfo | null | undefined ) : x is AddressInfo => typeof x === 'object'
205205 if ( isAddressInfo ( address ) ) {
206206 viteDevServerUrl = userConfig . server ?. origin ? userConfig . server . origin as DevServerUrl : resolveDevServerUrl ( address , server . config , userConfig )
207- fs . writeFileSync ( pluginConfig . hotFile , viteDevServerUrl )
207+
208+ fs . writeFileSync ( pluginConfig . hotFile , `${ viteDevServerUrl } ${ server . config . base . replace ( / \/ $ / , '' ) } ` )
208209
209210 setTimeout ( ( ) => {
210211 server . config . logger . info ( `\n ${ colors . red ( `${ colors . bold ( 'LARAVEL' ) } ${ laravelVersion ( ) } ` ) } ${ colors . dim ( 'plugin' ) } ${ colors . bold ( `v${ pluginVersion ( ) } ` ) } ` )
@@ -431,9 +432,8 @@ function resolveDevServerUrl(address: AddressInfo, config: ResolvedConfig, userC
431432
432433 const configHmrClientPort = typeof config . server . hmr === 'object' ? config . server . hmr . clientPort : null
433434 const port = configHmrClientPort ?? address . port
434- const base = config . base . replace ( / \/ $ / , '' )
435435
436- return `${ protocol } ://${ host } :${ port } ${ base } `
436+ return `${ protocol } ://${ host } :${ port } `
437437}
438438
439439function isIpv6 ( address : AddressInfo ) : boolean {
0 commit comments