Skip to content

refactor(@angular/build): allow Bazel to inject a custom esbuild plugin#31598

Merged
clydin merged 1 commit intoangular:20.3.xfrom
clydin:bazel-esbuild-env-var-20.3.x
Oct 24, 2025
Merged

refactor(@angular/build): allow Bazel to inject a custom esbuild plugin#31598
clydin merged 1 commit intoangular:20.3.xfrom
clydin:bazel-esbuild-env-var-20.3.x

Conversation

@clydin
Copy link
Member

@clydin clydin commented Oct 24, 2025

Introduces a mechanism to dynamically load a custom esbuild plugin when the application builder is executed within a Bazel environment.

This is enabled by a new bazelEsbuildPluginPath option, which is derived from the NG_INTERNAL_ESBUILD_PLUGINS_DO_NOT_USE environment variable. The path is only resolved if the BAZEL_BINDIR and JS_BINARY__EXECROOT environment variables are also present, ensuring the logic is only active during a Bazel build.

The builder dynamically imports the plugin from the specified path and adds it to the esbuild pipeline, allowing for build-system-specific customizations.

(cherry picked from commit ec739d7)

Introduces a mechanism to dynamically load a custom esbuild plugin when the application builder is executed within a Bazel environment.

This is enabled by a new `bazelEsbuildPluginPath` option, which is derived from the `NG_INTERNAL_ESBUILD_PLUGINS_DO_NOT_USE` environment variable. The path is only resolved if the `BAZEL_BINDIR` and `JS_BINARY__EXECROOT` environment variables are also present, ensuring the logic is only active during a Bazel build.

The builder dynamically imports the plugin from the specified path and adds it to the esbuild pipeline, allowing for build-system-specific customizations.

(cherry picked from commit ec739d7)
@clydin clydin requested a review from devversion October 24, 2025 14:59
@clydin clydin added the target: patch This PR is targeted for the next patch release label Oct 24, 2025
@clydin clydin added the action: merge The PR is ready for merge by the caretaker label Oct 24, 2025
@clydin clydin merged commit 2c7581c into angular:20.3.x Oct 24, 2025
34 checks passed
@clydin clydin deleted the bazel-esbuild-env-var-20.3.x branch October 24, 2025 15:49
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants