diff options
| author | Xnuk Shuman <admin@xnu.kr> | 2022-12-10 14:55:04 +0900 |
|---|---|---|
| committer | Xnuk Shuman <admin@xnu.kr> | 2022-12-10 14:55:04 +0900 |
| commit | 6d6629eb505e6472ce57c31706ce0d21441fafdf (patch) | |
| tree | c5673583f438d1345591a3f77e3a068f3c590dd2 /build | |
| parent | d9dbd7064b13b4bce8aa90c7691b7a2b2f97a73e (diff) | |
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
Diffstat (limited to 'build')
| -rw-r--r-- | build/build.js | 4 |
1 files changed, 4 insertions, 0 deletions
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) + } }) |
