Skip to content

Commit

Permalink
perf(@angular-devkit/build-angular): reduce JSON stats
Browse files Browse the repository at this point in the history
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
  • Loading branch information
alan-agius4 committed May 13, 2021
1 parent 80a08b5 commit d9566bf
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions packages/angular_devkit/build_angular/src/webpack/utils/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import * as path from 'path';
import * as textTable from 'text-table';
import { Configuration, StatsCompilation } from 'webpack';
import { colors as ansiColors, removeColor } from '../../utils/color';
import { getWebpackStatsConfig } from '../configs/stats';

export function formatSize(size: number): string {
if (size <= 0) {
Expand Down Expand Up @@ -332,17 +333,7 @@ export function createWebpackLoggingCallback(
logger.info(stats.toString(config.stats));
}

webpackStatsLogger(
logger,
stats.toJson({
errors: true,
warnings: true,
builtAt: true,
assets: true,
chunks: true,
}),
config,
);
webpackStatsLogger(logger, stats.toJson(getWebpackStatsConfig(false)), config);
};
}

Expand Down

0 comments on commit d9566bf

Please sign in to comment.