mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
This wires up the `@angular/localize/tools` entry-point. For context: This entry-point is being created to avoid deep imports into `@angular/localize/src/tools/<..>` like the CLI relies on. Deep imports do not play well with strict ESM, and now that all APF packages are strict ESM, the tool code needs to be either strict ESM as well. We use ESBuild to create individual bundles for the CLI entry-points, and the actual tool entry-point. We use a bundler because this enables the localize code be ESM compatible. Without a bundler, all relative imports within the `tools` entry-point would need to explicitly have the `.js` extension. This would be cumbersome and hard to maintain/enforce or validate. One might wonder why this is not a standard APF entry-point then. The answer is that the APF entry-points do not support exposing the CLI binaries (like `yarn localize-translate`). This could be done through tertiary entry-points, but using ESBuild directly gives us more control for now. We might want to revisit this in the future again. PR Close #43431
202 B
202 B
Disclaimer
The localize tools are consumed via the Angular CLI. The programmatic APIs are not considered officially supported though and are not subject to the breaking change guarantees of SemVer.