Skip to content

Commit 8cdc9d1

Browse files
LinusBorgyyx990803
authored andcommitted
fix(dev-server): pass 2nd argument to devServer.before (#1854)
closes #1833
1 parent a1097f2 commit 8cdc9d1

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,17 +132,17 @@ module.exports = (api, options) => {
132132
}, projectDevServerOptions, {
133133
https: useHttps,
134134
proxy: proxySettings,
135-
before (app) {
135+
before (app, server) {
136136
// launch editor support.
137137
// this works with vue-devtools & @vue/cli-overlay
138138
app.use('/__open-in-editor', launchEditorMiddleware(() => console.log(
139139
`To specify an editor, sepcify the EDITOR env variable or ` +
140140
`add "editor" field to your Vue project config.\n`
141141
)))
142142
// allow other plugins to register middlewares, e.g. PWA
143-
api.service.devServerConfigFns.forEach(fn => fn(app))
143+
api.service.devServerConfigFns.forEach(fn => fn(app, server))
144144
// apply in project middlewares
145-
projectDevServerOptions.before && projectDevServerOptions.before(app)
145+
projectDevServerOptions.before && projectDevServerOptions.before(app, server)
146146
}
147147
}))
148148

0 commit comments

Comments
 (0)