mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-26 06:48:16 -05:00
fix: optimize the judgment on whether HTTPS has been set in options (#7202)
This commit is contained in:
@@ -101,7 +101,11 @@ module.exports = (api, options) => {
|
||||
}
|
||||
|
||||
// resolve server options
|
||||
const useHttps = args.https || projectDevServerOptions.https || defaults.https
|
||||
const modesUseHttps = ['https', 'http2']
|
||||
const serversUseHttps = ['https', 'spdy']
|
||||
const optionsUseHttps = modesUseHttps.some(modeName => !!projectDevServerOptions[modeName]) ||
|
||||
(typeof projectDevServerOptions.server === 'string' && serversUseHttps.includes(projectDevServerOptions.server))
|
||||
const useHttps = args.https || optionsUseHttps || defaults.https
|
||||
const protocol = useHttps ? 'https' : 'http'
|
||||
const host = args.host || process.env.HOST || projectDevServerOptions.host || defaults.host
|
||||
portfinder.basePort = args.port || process.env.PORT || projectDevServerOptions.port || defaults.port
|
||||
|
||||
Reference in New Issue
Block a user