3c7da767d8
In ngcc's reflection host for UMD and CommonJS bundles, custom logic is present to resolve import details of an identifier. However, this custom logic is unable to resolve an import for an identifier inside of declaration files, as such files use the regular ESM import syntax. As a consequence of this limitation, ngtsc is unable to resolve `ModuleWithProviders` imports that are declared in an external library. In that situation, ngtsc determines the type of the actual `NgModule` that is imported, by looking in the library's declaration files for the generic type argument on `ModuleWithProviders`. In this process, ngtsc resolves the import for the `ModuleWithProviders` identifier to verify that it is indeed the `ModuleWithProviders` type from `@angular/core`. So, when the UMD reflection host was in use this resolution would fail, therefore no `NgModule` type could be detected. This commit fixes the bug by using the regular import resolution logic in addition to the custom resolution logic that is required for UMD and CommonJS bundles. Fixes #31791 PR Close #32619 |
||
---|---|---|
.. | ||
src | ||
test | ||
BUILD.bazel | ||
README.md | ||
index.ts | ||
main-ngcc.ts |
README.md
Angular Compatibility Compiler (ngcc)
This compiler will convert node_modules
compiled with ngc
, into node_modules
which
appear to have been compiled with ngtsc
.
This conversion will allow such "legacy" packages to be used by the Ivy rendering engine.
Building
The project is built using Bazel:
yarn bazel build //packages/compiler-cli/ngcc
Unit Testing
The unit tests are built and run using Bazel:
yarn bazel test //packages/compiler-cli/ngcc/test
Integration Testing
There are tests that check the behavior of the overall executable:
yarn bazel test //packages/compiler-cli/ngcc/test:integration