angular/packages/compiler-cli
Paul Gschwendtner 11a81898be refactor(compiler-cli): remove dynamic require in ngcc to allow for bundling (#43431)
ngcc currently dynamially loads the `Transformer` code. It does this
to avoid unnecessary parsing and loading of transformer-related code
if there is nothing to process (so-called noop case). Unfortunately
this dynamic require is not recognized by ESBuild. The import needs
to be discovered as otheriwse the transformer code would not be included
in the bundled package output of the CLI.

The ngcc code needs to use an async runtime import as it would work
in ES modules. This introduces async code into to the compililation
pipeline, breaking the `ngccMain` synchronous invocation feature.

To avoid this, we just move the dynamic require/async import to
the file top-level so that we do not break synchronous processing
which the CLI relies on. This has the downside of slowing-down
the noop case a little but I believe that should be mitigated
through bundling of ngcc anyway. In the future with full-ESM
we won't be able to get around this anyway (unless we remove the
sync variant of ngcc processing).

PR Close #43431
2021-10-01 18:28:43 +00:00
..
integrationtest refactor(compiler-cli): remove listLazyRoutes operation (#43591) 2021-09-29 14:45:18 -07:00
linker refactor(compiler): combine call ASTs (#42882) 2021-09-21 20:55:29 +00:00
ngcc refactor(compiler-cli): remove dynamic require in ngcc to allow for bundling (#43431) 2021-10-01 18:28:43 +00:00
private refactor: switch packages away from deep cross-package imports (#43431) 2021-10-01 18:28:43 +00:00
src refactor: switch packages away from deep cross-package imports (#43431) 2021-10-01 18:28:43 +00:00
test refactor(compiler-cli): remove listLazyRoutes operation (#43591) 2021-09-29 14:45:18 -07:00
BUILD.bazel refactor(compiler-cli): remove dynamic require in ngcc to allow for bundling (#43431) 2021-10-01 18:28:43 +00:00
esbuild.config.js refactor: setup bundling for @angular/compiler-cli package (#43431) 2021-10-01 18:28:42 +00:00
index.ts refactor(compiler-cli): expose code needed by Angular CLI (#43431) 2021-10-01 18:28:43 +00:00
package.json refactor(compiler-cli): expose code needed by Angular CLI (#43431) 2021-10-01 18:28:43 +00:00
tsconfig-build.json build: update tsconfigs to use ES2020 as target and module (#43431) 2021-10-01 18:28:42 +00:00
tsconfig.json build: update tsconfigs to use ES2020 as target and module (#43431) 2021-10-01 18:28:42 +00:00