638ba4a2cf
Packages that do not follow APF may have the declaration files in the same directory as one source format, typically ES5. This is problematic for ngcc, as it needs to create a TypeScript program with all JavaScript sources of an entry-point, whereas TypeScript's module resolution mechanism would have resolved an internal module import to the external facing .d.ts declaration file, instead of the JavaScript source file. This behavior results in the program to be analysed being incomplete. This commit introduces a custom compiler host that recognizes the above scenario and rewires the resolution of a .d.ts declaration file to its JavaScript counterpart, if applicable. Fixes #29939 PR Close #30017 |
||
---|---|---|
.. | ||
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