Skip to content

Commit

Permalink
fix(build): show full error stats (#2879)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipesilva authored and hansl committed Nov 7, 2016
1 parent c27cc85 commit d59fa1f
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions packages/angular-cli/tasks/build-webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ export default <any>Task.extend({
runTaskOptions.aot
).config;

// fail on build error
config.bail = true;

const webpackCompiler: any = webpack(config);

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

return new Promise((resolve, reject) => {
webpackCompiler.run((err: any, stats: any) => {
if (err) { return reject(err); }

// Don't keep cache
// TODO: Make conditional if using --watch
webpackCompiler.purgeInputFileSystem();

if (err) {
lastHash = null;
console.error(err.details || err);
reject(err.details || err);
}

if (stats.hash !== lastHash) {
lastHash = stats.hash;
process.stdout.write(stats.toString(webpackOutputOptions) + '\n');
}
resolve();

return stats.hasErrors() ? reject() : resolve();
});
});
}
Expand Down

0 comments on commit d59fa1f

Please sign in to comment.