Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(bazel): ng_package rule should update "package.json" of ts_librar…
…y targets (#36944) In the past we added support for `ts_library` to `ng_package`. For those targets we never can determine the "index" file. Unlike `ng_module`, there is no provider data for flat module bundles, so the `ng_package` rule assumes that the index file is simply called `index`. This works as expected, but we also added logic in the past that doesn't allow `ng_package` to add format properties (e.g. `main`, `module`) to a `package.json` if a package json is handwritten for such a `ts_library` target. This has been done that way because we assumed that such `package.json` files might want to set format properties explicitly to different paths due to a faulty "index" guess. We want to change this behavior as most of the time a `package.json` file already exists with just the module name. In those cases, the packager should still set the format properties. We should only warn and skip automatic insertion of the format properties if such a `package.json` explicitly sets format properties. PR Close #36944
- Loading branch information