From 0260e4dacd89b6edf63bef07fd80d3b6108f72b5 Mon Sep 17 00:00:00 2001 From: BackRunner Date: Thu, 7 Jul 2022 16:35:27 +0800 Subject: [PATCH] fix: add devServer.server.type to useHttps judgement (#7222) --- packages/@vue/cli-service/lib/commands/serve.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@vue/cli-service/lib/commands/serve.js b/packages/@vue/cli-service/lib/commands/serve.js index b0063cb6cc..aef507398c 100644 --- a/packages/@vue/cli-service/lib/commands/serve.js +++ b/packages/@vue/cli-service/lib/commands/serve.js @@ -108,7 +108,8 @@ module.exports = (api, options) => { const modesUseHttps = ['https', 'http2'] const serversUseHttps = ['https', 'spdy'] const optionsUseHttps = modesUseHttps.some(modeName => !!projectDevServerOptions[modeName]) || - (typeof projectDevServerOptions.server === 'string' && serversUseHttps.includes(projectDevServerOptions.server)) + (typeof projectDevServerOptions.server === 'string' && serversUseHttps.includes(projectDevServerOptions.server)) || + (typeof projectDevServerOptions.server === 'object' && projectDevServerOptions.server !== null && serversUseHttps.includes(projectDevServerOptions.server.type)) const useHttps = args.https || optionsUseHttps || defaults.https const protocol = useHttps ? 'https' : 'http' const host = args.host || process.env.HOST || projectDevServerOptions.host || defaults.host