Skip to content

Commit 7a5964d

Browse files
author
Guillaume Chau
committed
fix(ui): webpack dashboard fixes
1 parent 3000bdf commit 7a5964d

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

packages/@vue/cli-ui/apollo-server/connectors/plugins.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ function resetPluginApi (context) {
121121
const projects = require('./projects')
122122
const project = projects.getCurrent(context)
123123
if (!project) return
124+
projectId = project.id
125+
pluginApi.project = project
124126
if (projectId !== project.id) {
125-
projectId = project.id
126-
pluginApi.project = project
127127
callHook('projectOpen', [project, projects.getLast(context)], context)
128128
} else {
129129
callHook('pluginReload', [project], context)

packages/@vue/cli-ui/ui-defaults/tasks.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ module.exports = api => {
2323
'modern-mode': false
2424
}
2525

26+
// Init data
27+
api.onProjectOpen(setup)
28+
api.onPluginReload(setup)
29+
30+
function setup () {
31+
for (const key of ['serve', 'build', 'build-modern']) {
32+
setupSharedData(key)
33+
}
34+
setupCommonData()
35+
}
36+
2637
// Called when opening a project
2738
function setupSharedData (mode) {
2839
resetSharedData(mode)
@@ -141,14 +152,6 @@ module.exports = api => {
141152
}
142153
}
143154

144-
// Init data
145-
api.onProjectOpen(() => {
146-
for (const key of ['serve', 'build', 'build-modern']) {
147-
setupSharedData(key)
148-
}
149-
setupCommonData()
150-
})
151-
152155
// Tasks
153156
const views = {
154157
views: [

0 commit comments

Comments
 (0)