mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-21 22:34:21 +08:00
feat(@angular/cli): hide error/warning build output stacktraces
This commit is contained in:
parent
4a8f5bdc65
commit
fc1e08deaa
@ -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) {
|
||||
|
@ -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 {
|
||||
|
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user