From 6056ce302c215dd4e7513cdd540f30a46f6990cb Mon Sep 17 00:00:00 2001 From: J Huang Date: Thu, 5 Jan 2017 22:53:23 +0800 Subject: [PATCH] fix(webpack): workaround for webpack does not bail see https://github.com/webpack/webpack/issues/2390 --- src/scripts/build.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/scripts/build.js b/src/scripts/build.js index 890ff1f..a7a45dd 100755 --- a/src/scripts/build.js +++ b/src/scripts/build.js @@ -46,6 +46,11 @@ export default function build() colors: true })) + //fixme: remove this snippet when https://github.com/webpack/webpack/issues/2390 is fixed + if (stats.hasErrors()) { + process.exit(1) + } + var jsonStats = stats.toJson() fse.writeJsonSync(path.resolve(buildFolderClient, "stats.json"), jsonStats) callback() @@ -72,6 +77,11 @@ export default function build() colors: true })) + //fixme: remove this snippet when https://github.com/webpack/webpack/issues/2390 is fixed + if (stats.hasErrors()) { + process.exit(1) + } + var jsonStats = stats.toJson() fse.writeJsonSync(path.resolve(buildFolderServer, "stats.json"), jsonStats) callback()