fix: support devServer.server option, avoid deprecation warning

Closes #7024
Fixes #7118

I choose to not merge the PR because I don't want add additional ways
to configure https for dev server (`--http2` command line argument,
`process.env.HTTPS`, etc.)

In the current implementation, `spdy` can only be configured by setting
`{ devServer: server: { type: 'spdy' } }`.
This is a deliberate choice, because SPDY support in Node.js 15+ is
broken anyway. I don't want bother refactoring the old code to
accommodate this broken feature.
This commit is contained in:
Haoqun Jiang
2022-07-04 21:02:14 +08:00
parent bddd64d5b7
commit 558dea2af6

View File

@@ -199,7 +199,14 @@ module.exports = (api, options) => {
}, projectDevServerOptions, {
host,
port,
https: useHttps,
server: {
type: protocol,
...(typeof projectDevServerOptions.server === 'object'
? projectDevServerOptions.server
: {})
},
proxy: proxySettings,
static: {