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
This commit is contained in:
Alan Agius 2019-03-15 15:06:57 +01:00 committed by Alex Eagle
parent 20a644ec4b
commit f71896874e
2 changed files with 8 additions and 0 deletions

View File

@ -280,6 +280,7 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
? 'production'
: 'development',
devtool: false,
profile: buildOptions.statsJson,
resolve: {
extensions: ['.ts', '.tsx', '.mjs', '.js'],
symlinks: !buildOptions.preserveSymlinks,

View File

@ -23,4 +23,11 @@ describe('Browser Builder stats json', () => {
const { files } = await browserBuild(architect, host, target, { statsJson: true });
expect('stats.json' in files).toBe(true);
});
it('works with profile flag', async () => {
const { files } = await browserBuild(architect, host, target, { statsJson: true });
expect('stats.json' in files).toBe(true);
const stats = await files['stats.json'];
expect(stats).toMatch(/profile.+building/);
});
});