Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/@vue/cli-service/lib/commands/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,12 @@ module.exports = (api, options) => {
}
}

// Compatible with server in webpack5
const projectDevServerType = typeof projectDevServerOptions.server === 'string' ? projectDevServerOptions.server : typeof (projectDevServerOptions.server || {}).type === 'string' ? projectDevServerOptions.server.type : 'http'
const httpsTypes = ['https', 'spdy']

// resolve server options
const useHttps = args.https || projectDevServerOptions.https || defaults.https
const useHttps = args.https || args.http2 || projectDevServerOptions.https || defaults.https || httpsTypes.includes(args['server-type']) || httpsTypes.includes(projectDevServerType)
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
Expand Down