Skip to content

Commit 6023c2e

Browse files
author
Guillaume Chau
committed
fix(ui): clear webpack stats before run
1 parent 6649988 commit 6023c2e

File tree

1 file changed

+12
-11
lines changed
  • packages/@vue/cli-ui/ui-defaults

1 file changed

+12
-11
lines changed

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

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,20 @@ module.exports = api => {
3030
}
3131
}
3232

33-
function resetSharedData (mode) {
33+
function resetSharedData (mode, clear = false) {
3434
for (const field in fields) {
3535
const id = `${mode}-${field}`
36-
setSharedData(id, getSharedDataInitialValue(id, field))
36+
setSharedData(id, getSharedDataInitialValue(id, field, clear))
3737
}
3838
}
3939

40-
function getSharedDataInitialValue (id, field) {
41-
const project = api.getProject()
42-
if (project) {
43-
const data = getSharedData(`${project.id}-${id}`)
44-
if (data != null) return data.value
40+
function getSharedDataInitialValue (id, field, clear) {
41+
if (!clear) {
42+
const project = api.getProject()
43+
if (project) {
44+
const data = getSharedData(`${project.id}-${id}`)
45+
if (data != null) return data.value
46+
}
4547
}
4648
return fields[field]
4749
}
@@ -185,8 +187,7 @@ module.exports = api => {
185187
args.push('--dashboard')
186188

187189
// Data
188-
resetSharedData('serve')
189-
removeSharedData('serve-url')
190+
resetSharedData('serve', true)
190191
firstRun = true
191192
hadFailed = false
192193
},
@@ -288,8 +289,8 @@ module.exports = api => {
288289
args.push('--dashboard')
289290

290291
// Data
291-
resetSharedData('build')
292-
resetSharedData('build-modern')
292+
resetSharedData('build', true)
293+
resetSharedData('build-modern', true)
293294
},
294295
onRun: () => {
295296
api.ipcOn(onWebpackMessage)

0 commit comments

Comments
 (0)