Skip to content

Commit

Permalink
fix(worker): fail when build result hasErrors() (#130)
Browse files Browse the repository at this point in the history
Fix #120
  • Loading branch information
jbedard authored Nov 6, 2023
1 parent 12074bb commit 18ac3b0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions webpack/private/webpack_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ class WebpackWorker extends WebpackCLI {
if (err && this.reject) {
this.console.error(err)
this.reject(err)
} else if (stats.hasErrors() && this.reject) {
const statErr = new Error(stats.toJson().errors)
this.console.error(statErr)
this.reject(statErr)
} else if (!err && this.resolve) {
this.console.log(stats.toString())
this.resolve(0)
Expand Down

0 comments on commit 18ac3b0

Please sign in to comment.