Skip to content

Commit 59fdf07

Browse files
filipesilvaMRHarrison
authored andcommitted
fix(build): show full error stats (angular#2879)
1 parent 88ccf15 commit 59fdf07

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

packages/angular-cli/tasks/build-webpack.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ export default <any>Task.extend({
2626
runTaskOptions.aot
2727
).config;
2828

29-
// fail on build error
30-
config.bail = true;
31-
3229
const webpackCompiler: any = webpack(config);
3330

3431
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
@@ -39,21 +36,18 @@ export default <any>Task.extend({
3936

4037
return new Promise((resolve, reject) => {
4138
webpackCompiler.run((err: any, stats: any) => {
39+
if (err) { return reject(err); }
40+
4241
// Don't keep cache
4342
// TODO: Make conditional if using --watch
4443
webpackCompiler.purgeInputFileSystem();
4544

46-
if (err) {
47-
lastHash = null;
48-
console.error(err.details || err);
49-
reject(err.details || err);
50-
}
51-
5245
if (stats.hash !== lastHash) {
5346
lastHash = stats.hash;
5447
process.stdout.write(stats.toString(webpackOutputOptions) + '\n');
5548
}
56-
resolve();
49+
50+
return stats.hasErrors() ? reject() : resolve();
5751
});
5852
});
5953
}

0 commit comments

Comments
 (0)