Skip to content

Commit 3894a4a

Browse files
committed
feat: respect devServer field in webpack config as well
close #2053
1 parent 185ae6d commit 3894a4a

File tree

1 file changed

+7
-3
lines changed
  • packages/@vue/cli-service/lib/commands

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,16 @@ module.exports = (api, options) => {
4242
const prepareProxy = require('../util/prepareProxy')
4343
const launchEditorMiddleware = require('launch-editor-middleware')
4444

45-
// load user devServer options
46-
const projectDevServerOptions = options.devServer || {}
47-
4845
// resolve webpack config
4946
const webpackConfig = api.resolveWebpackConfig()
5047

48+
// load user devServer options with higher priority than devServer
49+
// in webpck config
50+
const projectDevServerOptions = Object.assign(
51+
webpackConfig.devServer || {},
52+
options.devServer
53+
)
54+
5155
// expose advanced stats
5256
if (args.dashboard) {
5357
const DashboardPlugin = require('../webpack/DashboardPlugin')

0 commit comments

Comments
 (0)