File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -169,11 +169,16 @@ function resolveLaravelPlugin(pluginConfig: Required<PluginConfig>): LaravelPlug
169169
170170 const isAddressInfo = ( x : string | AddressInfo | null | undefined ) : x is AddressInfo => typeof x === 'object'
171171 if ( isAddressInfo ( address ) ) {
172- const protocol = server . config . server . https ? 'https' : 'http'
172+ const configHmrProtocol = typeof server . config . server . hmr === 'object' ? server . config . server . hmr . protocol : null
173+ const clientHmrProtocol = configHmrProtocol ? ( configHmrProtocol === 'wss' ? 'https' : 'http' ) : null
174+ const configProtocol = server . config . server . https ? 'https' : 'http'
175+ const protocol = clientHmrProtocol ?? configProtocol
176+
173177 const configHmrHost = typeof server . config . server . hmr === 'object' ? server . config . server . hmr . host : null
174178 const configHost = typeof server . config . server . host === 'string' ? server . config . server . host : null
175179 const serverAddress = address . family === 'IPv6' ? `[${ address . address } ]` : address . address
176180 const host = configHmrHost ?? configHost ?? serverAddress
181+
177182 viteDevServerUrl = `${ protocol } ://${ host } :${ address . port } `
178183 fs . writeFileSync ( hotFile , viteDevServerUrl )
179184
You can’t perform that action at this time.
0 commit comments