From 6d6629eb505e6472ce57c31706ce0d21441fafdf Mon Sep 17 00:00:00 2001 From: Xnuk Shuman Date: Sat, 10 Dec 2022 14:55:04 +0900 Subject: [PATCH] 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 --- build/build.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/build.js b/build/build.js index 35969eb6..8242bc5f 100644 --- a/build/build.js +++ b/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) + } })