Skip to content

Commit d5a46a1

Browse files
committed
perf(@angular-devkit/build-angular): reduce JSON stats
With this change we reduce the size of the JSON stats object, the main benefit that this change brings is that unspecified stats now default to `false`, due to the `all: false` configuration in https://github.com/angular/angular-cli/blob/e992c9a70b55b6cedbe15e4af7ad9c287a33ee29/packages/angular_devkit/build_angular/src/webpack/configs/stats.ts#L12 (cherry picked from commit d9566bf)
1 parent ca4d99d commit d5a46a1

File tree

1 file changed

+2
-11
lines changed
  • packages/angular_devkit/build_angular/src/webpack/utils

1 file changed

+2
-11
lines changed

packages/angular_devkit/build_angular/src/webpack/utils/stats.ts

+2-11
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import * as path from 'path';
1212
import * as textTable from 'text-table';
1313
import { Configuration, StatsCompilation } from 'webpack';
1414
import { colors as ansiColors, removeColor } from '../../utils/color';
15+
import { getWebpackStatsConfig } from '../configs/stats';
1516

1617
export function formatSize(size: number): string {
1718
if (size <= 0) {
@@ -332,17 +333,7 @@ export function createWebpackLoggingCallback(
332333
logger.info(stats.toString(config.stats));
333334
}
334335

335-
webpackStatsLogger(
336-
logger,
337-
stats.toJson({
338-
errors: true,
339-
warnings: true,
340-
builtAt: true,
341-
assets: true,
342-
chunks: true,
343-
}),
344-
config,
345-
);
336+
webpackStatsLogger(logger, stats.toJson(getWebpackStatsConfig(false)), config);
346337
};
347338
}
348339

0 commit comments

Comments
 (0)