Repository navigation
fix(@angular/build): conditionally declare tslib in built library package - #34227
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the library builder pipeline to automatically and conditionally inject tslib into the generated package.json dependencies when any output chunks import it, while preserving any user-defined tslib versions. It also ensures this dependency is correctly updated during watch mode when imports change. The feedback suggests a minor improvement to use a standard file path like package.json instead of a directory path with a trailing slash when initializing createRequire for better robustness.
…kage Inspects Rolldown output chunk imports to detect whether any generated library bundle imports `tslib` (for example, when custom decorators or explicit resource management helpers are emitted). When `tslib` is imported and not already declared in the library's `package.json` `dependencies`, resolves the `tslib` version range from `@angular/compiler` (with fallback to `tslib/package.json`) and adds it to the emitted `package.json`. Closes angular#34131
0033c28 to
60dcf28
Compare
|
This PR was merged into the repository. The changes were merged into the following branches:
|
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Inspects Rolldown output chunk imports to detect whether any generated library bundle imports
tslib(for example, when custom decorators or explicit resource management helpers are emitted). Whentslibis imported and not already declared in the library'spackage.jsondependencies, resolves thetslibversion range from@angular/compiler(with fallback totslib/package.json) and adds it to the emittedpackage.json.Closes #34131