Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ngcc): prevent including JavaScript sources outside of the package (
#37596) When ngcc creates an entry-point program, the `allowJs` option is enabled in order to operate on the JavaScript source files of the entry-point. A side-effect of this approach is that external modules that don't ship declaration files will also have their JavaScript source files loaded into the program, as the `allowJs` flag allows for them to be imported. This may pose an issue in certain edge cases, where ngcc would inadvertently operate on these external modules. This can introduce all sorts of undesirable behavior and incompatibilities, e.g. the reflection host that is selected for the entry-point's format could be incompatible with that of the external module's JavaScript bundles. To avoid these kinds of issues, module resolution that would resolve to a JavaScript file located outside of the package will instead be rejected, as if the file would not exist. This would have been the behavior when `allowJs` is set to false, which is the case in typical Angular compilations. Fixes #37508 PR Close #37596
- Loading branch information
1 parent
b13daa4
commit 4b90b6a
Showing
5 changed files
with
236 additions
and
8 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
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
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