From 558dea2af693893ca75e372f286d92152bc8d960 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Mon, 4 Jul 2022 21:02:14 +0800 Subject: [PATCH] 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. --- packages/@vue/cli-service/lib/commands/serve.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/@vue/cli-service/lib/commands/serve.js b/packages/@vue/cli-service/lib/commands/serve.js index c4fad51798..87e6b95cd4 100644 --- a/packages/@vue/cli-service/lib/commands/serve.js +++ b/packages/@vue/cli-service/lib/commands/serve.js @@ -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: {