Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 3df19bf

Browse files
committed
refactor(webpack): enable throwing errors on webpack build errors
1 parent 1c57ee6 commit 3df19bf

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/webpack.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,16 @@ export function runWebpackFullBuild(config: WebpackConfig) {
142142
if (err) {
143143
reject(new BuildError(err));
144144
} else {
145-
resolve(stats);
145+
const info = stats.toJson();
146+
147+
if (stats.hasErrors()) {
148+
reject(new BuildError(info.errors));
149+
} else if (stats.hasWarnings()) {
150+
Logger.debug(info.warnings);
151+
resolve(stats);
152+
} else {
153+
resolve(stats);
154+
}
146155
}
147156
};
148157
const compiler = webpackApi(config);

0 commit comments

Comments
 (0)