Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bddd64d

Browse files
fix: optimize the judgment on whether HTTPS has been set in options (#7202)
1 parent ef08a08 commit bddd64d

File tree

1 file changed

+5
-1
lines changed
  • packages/@vue/cli-service/lib/commands

1 file changed

+5
-1
lines changed

‎packages/@vue/cli-service/lib/commands/serve.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ module.exports = (api, options) => {
101101
}
102102

103103
// resolve server options
104-
const useHttps = args.https || projectDevServerOptions.https || defaults.https
104+
const modesUseHttps = ['https', 'http2']
105+
const serversUseHttps = ['https', 'spdy']
106+
const optionsUseHttps = modesUseHttps.some(modeName => !!projectDevServerOptions[modeName]) ||
107+
(typeof projectDevServerOptions.server === 'string' && serversUseHttps.includes(projectDevServerOptions.server))
108+
const useHttps = args.https || optionsUseHttps || defaults.https
105109
const protocol = useHttps ? 'https' : 'http'
106110
const host = args.host || process.env.HOST || projectDevServerOptions.host || defaults.host
107111
portfinder.basePort = args.port || process.env.PORT || projectDevServerOptions.port || defaults.port

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /