Skip to content

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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