Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ngcc): correctly retrieve a package's version from its `package.j…
…son` (#37040) In order to retrieve the ngcc configuration (if any) for an entry-point, ngcc has to detect the containing package's version. Previously, ngcc would try to read the version from the entry-point's `package.json` file, which was different than the package's top-level `package.json` for secondary entry-points. For example, it would try to read it from `node_modules/@angular/common/http/package.json` for entry-point `@angular/common/http`. However, the `package.json` files for secondary entry-points are not guaranteed to include a `version` property. This commit fixes this by first trying to read the version from the _package's_ `package.json` (falling back to the entry-point's `package.json`). For example, it will first try to read it from `@angular/common/package.json` for entry-point `@angular/common/http`. PR Close #37040
- Loading branch information
1 parent
cc18220
commit c027a5e
Showing
2 changed files
with
118 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters