mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
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 |
||
|---|---|---|
| .. | ||
| compliance | ||
| diagnostics | ||
| metadata | ||
| ngtsc | ||
| transformers | ||
| BUILD.bazel | ||
| extract_i18n_spec.ts | ||
| mocks.ts | ||
| ngc_spec.ts | ||
| perform_compile_spec.ts | ||
| perform_watch_spec.ts | ||
| test_support.ts | ||
| typescript_support_spec.ts | ||