Throw non-zero exit code if webpack build fails

Not only `err`, `stats.hasErrors` also should be handled.
I found this bug in [Pipeline 42881 build] - some errors exist,
but build result was successful.

See also: https://webpack.js.org/api/node/#error-handling

[Pipeline 42881 build]: https://git.pleroma.social/pleroma/pleroma-fe/-/jobs/225066
shigusegubu^2
Xnuk Shuman 1 year ago
parent d9dbd7064b
commit 6d6629eb50
No known key found for this signature in database
GPG Key ID: B810FA3E0390F1F2
  1. 4
      build/build.js

@ -36,4 +36,8 @@ webpack(webpackConfig, function (err, stats) {
chunks: false,
chunkModules: false
}) + '\n')
if (stats.hasErrors()) {
console.error('See above for errors.')
process.exit(1)
}
})

Loading…
Cancel
Save