From 2196114501e83f5320a69af2d449ce327fba9b5e Mon Sep 17 00:00:00 2001 From: Alex Rickabaugh Date: Tue, 1 Oct 2019 15:27:21 +0300 Subject: [PATCH] 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 --- packages/compiler-cli/ngcc/main-ngcc.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/compiler-cli/ngcc/main-ngcc.ts b/packages/compiler-cli/ngcc/main-ngcc.ts index f25d1d250d..fe33eb9565 100644 --- a/packages/compiler-cli/ngcc/main-ngcc.ts +++ b/packages/compiler-cli/ngcc/main-ngcc.ts @@ -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) {