feat(ngcc): support --async flag (defaults to true) (#33192)

This allows disabling parallelism in ngcc if desired, which is mainly useful
for debugging. The implementation creates the flag and passes its value to
mainNgcc.

No tests are added since the feature mainly exists already - ngcc supports
both parallel and serial execution. This commit only allows switching the
flag via the commandline.

PR Close #33192
This commit is contained in:
Alex Rickabaugh 2019-10-01 15:27:21 +03:00 committed by Matias Niemelä
parent fd4fed14d8
commit 2196114501
1 changed files with 9 additions and 2 deletions

View File

@ -50,7 +50,14 @@ if (require.main === module) {
'If specified then new `*_ivy_ngcc` entry-points will be added to package.json rather than modifying the ones in-place.\n' +
'For this to work you need to have custom resolution set up (e.g. in webpack) to look for these new entry-points.\n' +
'The Angular CLI does this already, so it is safe to use this option if the project is being built via the CLI.',
type: 'boolean'
type: 'boolean',
})
.option('async', {
describe:
'Whether to compile asynchronously. This is enabled by default as it allows compilations to be parallelized.\n' +
'Disabling asynchronous compilation may be useful for debugging.',
type: 'boolean',
default: true,
})
.option('l', {
alias: 'loglevel',
@ -86,7 +93,7 @@ if (require.main === module) {
compileAllFormats,
createNewEntryPointFormats,
logger,
async: true,
async: options['async'],
});
if (logger) {