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 Daniel Roe
parent 6a39c657f5
commit 111a3c25a3
No known key found for this signature in database
GPG Key ID: 3714AB03996F442B
1 changed files with 1 additions and 1 deletions

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) {