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 = {
colors: true,
hash: true,
timings: true,
chunks: true,
hash: true, // required by custom stat output
timings: true, // required by custom stat output
chunks: true, // required by custom stat output
chunkModules: false,
children: false, // listing all children is very noisy in AOT and hides warnings/errors
modules: false,
reasons: false,
warnings: true,
assets: false, // listing all assets is very noisy when using assets directories
version: false
errors: true,
assets: true, // required by custom stat output
version: false,
errorDetails: false,
moduleTrace: false,
};
const verboseWebpackOutputOptions = {
@ -23,7 +26,9 @@ const verboseWebpackOutputOptions = {
assets: true,
version: 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) {

View File

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

View File

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