angular/packages/compiler-cli
Paul Gschwendtner b46b3cf43e refactor: remove remaining dynamic require usages in package output (#43431)
Removes the remaining usages of dynamic require statements in the
package output. Since we declare all shipped packages as strict ESM,
we cannot use dynamic require statements anymore. This commit switches
these usages to actual `import` statements.

Note: Tsickle continues to remain an optional dependency since bundling
does not work with its UMD package output. Also tsickle is rarely used by
consumers, if at all, so bundling does not really provide any significant
value. To continue keeping tsickle optional (since it's still needed by the
`annotateForClosureCompiler` option which is also respected in ngtsc), we
pass-through a tsickle instance as a parameter to `main`. This allows us to
keep the compile functions synchronous without having to refactor the majority
of the watch compilation code, and majority of tests for ngc, ngtsc.

Consumers (like the `ngc` bin entry-point) can then load tsickle based on their
module format. e.g. tsickle can be imported through `require` to keep everything
sync, but in ESM, the dynamic import can be used beforehand to pass `tsickle` to
the `main` function. We can revisit this in the future but for now this does the
trick without exceeding the scope of this commit..

PR Close #43431
2021-10-01 18:28:45 +00:00
..
integrationtest refactor(compiler-cli): remove listLazyRoutes operation (#43591) 2021-09-29 14:45:18 -07:00
linker refactor: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +00:00
ngcc refactor: remove remaining dynamic require usages in package output (#43431) 2021-10-01 18:28:45 +00:00
private refactor: switch packages away from deep cross-package imports (#43431) 2021-10-01 18:28:43 +00:00
src refactor: remove remaining dynamic require usages in package output (#43431) 2021-10-01 18:28:45 +00:00
test refactor: remove remaining dynamic require usages in package output (#43431) 2021-10-01 18:28:45 +00:00
BUILD.bazel refactor: remove remaining dynamic require usages in package output (#43431) 2021-10-01 18:28:45 +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: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +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