feat(@angular/cli): hide error/warning build output stacktraces

This commit is contained in:
Charles Lyding 2018-01-24 20:52:07 -05:00 committed by Filipe Silva
parent 4a8f5bdc65
commit fc1e08deaa
3 changed files with 13 additions and 8 deletions

View File

@ -6,16 +6,19 @@ export const ngAppResolve = (resolvePath: string): string => {
const webpackOutputOptions = { const webpackOutputOptions = {
colors: true, colors: true,
hash: true, hash: true, // required by custom stat output
timings: true, timings: true, // required by custom stat output
chunks: true, chunks: true, // required by custom stat output
chunkModules: false, chunkModules: false,
children: false, // listing all children is very noisy in AOT and hides warnings/errors children: false, // listing all children is very noisy in AOT and hides warnings/errors
modules: false, modules: false,
reasons: false, reasons: false,
warnings: true, warnings: true,
assets: false, // listing all assets is very noisy when using assets directories errors: true,
version: false assets: true, // required by custom stat output
version: false,
errorDetails: false,
moduleTrace: false,
}; };
const verboseWebpackOutputOptions = { const verboseWebpackOutputOptions = {
@ -23,7 +26,9 @@ const verboseWebpackOutputOptions = {
assets: true, assets: true,
version: true, version: true,
reasons: true, reasons: true,
chunkModules: false // TODO: set to true when console to file output is fixed chunkModules: false, // TODO: set to true when console to file output is fixed
errorDetails: true,
moduleTrace: true,
}; };
export function getWebpackStatsConfig(verbose = false) { export function getWebpackStatsConfig(verbose = false) {

View File

@ -44,7 +44,7 @@ export default Task.extend({
return reject(err); return reject(err);
} }
const json = stats.toJson('verbose'); const json = stats.toJson(statsConfig);
if (runTaskOptions.verbose) { if (runTaskOptions.verbose) {
this.ui.writeLine(stats.toString(statsConfig)); this.ui.writeLine(stats.toString(statsConfig));
} else { } else {

View File

@ -262,7 +262,7 @@ export default Task.extend({
const server = new WebpackDevServer(webpackCompiler, webpackDevServerConfiguration); const server = new WebpackDevServer(webpackCompiler, webpackDevServerConfiguration);
if (!serveTaskOptions.verbose) { if (!serveTaskOptions.verbose) {
webpackCompiler.plugin('done', (stats: any) => { webpackCompiler.plugin('done', (stats: any) => {
const json = stats.toJson('verbose'); const json = stats.toJson(statsConfig);
this.ui.writeLine(statsToString(json, statsConfig)); this.ui.writeLine(statsToString(json, statsConfig));
if (stats.hasWarnings()) { if (stats.hasWarnings()) {
this.ui.writeLine(statsWarningsToString(json, statsConfig)); this.ui.writeLine(statsWarningsToString(json, statsConfig));