Skip to content

Commit f718968

Browse files
Alan Agiusalexeagle
Alan Agius
authored andcommitted
feat(@angular-devkit/build-angular): enable webpack profile when using stats-json flag
More information about what `profile` does can be found here: https://webpack.js.org/api/stats Closes #13907
1 parent 20a644e commit f718968

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts

+1
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
280280
? 'production'
281281
: 'development',
282282
devtool: false,
283+
profile: buildOptions.statsJson,
283284
resolve: {
284285
extensions: ['.ts', '.tsx', '.mjs', '.js'],
285286
symlinks: !buildOptions.preserveSymlinks,

packages/angular_devkit/build_angular/test/browser/stats-json_spec_large.ts

+7
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,11 @@ describe('Browser Builder stats json', () => {
2323
const { files } = await browserBuild(architect, host, target, { statsJson: true });
2424
expect('stats.json' in files).toBe(true);
2525
});
26+
27+
it('works with profile flag', async () => {
28+
const { files } = await browserBuild(architect, host, target, { statsJson: true });
29+
expect('stats.json' in files).toBe(true);
30+
const stats = await files['stats.json'];
31+
expect(stats).toMatch(/profile.+building/);
32+
});
2633
});

0 commit comments

Comments
 (0)