fix(vite): don't force protocol if disabled devServer.https (#29049)

This commit is contained in:
Indrek Ardel 2024-09-18 22:53:48 +03:00 committed by GitHub
parent d6387e22e6
commit be7bb4a67f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -184,7 +184,7 @@ export async function buildClient (ctx: ViteBuildContext) {
if (clientConfig.server && clientConfig.server.hmr !== false) {
const serverDefaults: Omit<ServerOptions, 'hmr'> & { hmr: Exclude<ServerOptions['hmr'], boolean> } = {
hmr: {
protocol: ctx.nuxt.options.devServer.https ? 'wss' : 'ws',
protocol: ctx.nuxt.options.devServer.https ? 'wss' : undefined,
},
}
if (typeof clientConfig.server.hmr !== 'object' || !clientConfig.server.hmr.server) {