Skip to content

Commit

Permalink
fix(ui): clear webpack stats before run
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Jun 21, 2018
1 parent 6649988 commit 6023c2e
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions packages/@vue/cli-ui/ui-defaults/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,20 @@ module.exports = api => {
}
}

function resetSharedData (mode) {
function resetSharedData (mode, clear = false) {
for (const field in fields) {
const id = `${mode}-${field}`
setSharedData(id, getSharedDataInitialValue(id, field))
setSharedData(id, getSharedDataInitialValue(id, field, clear))
}
}

function getSharedDataInitialValue (id, field) {
const project = api.getProject()
if (project) {
const data = getSharedData(`${project.id}-${id}`)
if (data != null) return data.value
function getSharedDataInitialValue (id, field, clear) {
if (!clear) {
const project = api.getProject()
if (project) {
const data = getSharedData(`${project.id}-${id}`)
if (data != null) return data.value
}
}
return fields[field]
}
Expand Down Expand Up @@ -185,8 +187,7 @@ module.exports = api => {
args.push('--dashboard')

// Data
resetSharedData('serve')
removeSharedData('serve-url')
resetSharedData('serve', true)
firstRun = true
hadFailed = false
},
Expand Down Expand Up @@ -288,8 +289,8 @@ module.exports = api => {
args.push('--dashboard')

// Data
resetSharedData('build')
resetSharedData('build-modern')
resetSharedData('build', true)
resetSharedData('build-modern', true)
},
onRun: () => {
api.ipcOn(onWebpackMessage)
Expand Down

0 comments on commit 6023c2e

Please sign in to comment.