Skip to content

Commit

Permalink
fix(ui): process killed before ipc messages are sent
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Apr 17, 2018
1 parent e33bec6 commit 53d5d4e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/@vue/cli-service/lib/webpack/DashboardPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ function disconnectSendMessage () {
resetSendMessage()
}

// Prevent forced process exit
// (or else ipc messages may not be sent before kill)
process.exit = code => {
process.exitCode = code
}

resetSendMessage()
/* ----- */

Expand Down Expand Up @@ -234,10 +240,12 @@ class DashboardPlugin {
asset.gzipSize = assetSources && getGzipSize(assetSources.get(asset.name))
})

const hasErrors = stats.hasErrors()

handler([
{
type: 'status',
value: 'Success'
value: hasErrors ? 'Failed' : 'Success'
},
{
type: 'progress',
Expand All @@ -250,7 +258,7 @@ class DashboardPlugin {
{
type: 'stats',
value: {
errors: stats.hasErrors(),
errors: hasErrors,
warnings: stats.hasWarnings(),
data: statsData
}
Expand Down

0 comments on commit 53d5d4e

Please sign in to comment.