Previously, `ngcc` assumed that if a format property was defined in `package.json` it would point to a valid format-path (i.e. a file that is an entry-point for a specific format). This is generally the case, except if a format property is set to a non-string value (such as `package.json`) - either directly in the `package.json` (which is unusual) or in ngcc.config.js (which is a valid usecase, when one wants a format property to be ignored by `ngcc`). For example, the following config file would cause `ngcc` to throw: ``` module.exports = { packages: { 'test-package': { entryPoints: { '.': { override: { fesm2015: undefined, }, }, }, }, }, }; ``` This commit fixes it by ensuring that only format properties whose value is a string are considered by `ngcc`. For reference, this regression was introduced in #32052. Fixes #32188 PR Close #32205
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