Skip to content

Conversation

@clydin
Copy link
Member

@clydin clydin commented Oct 17, 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.

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.
@clydin clydin requested a review from devversion October 17, 2025 19:15
@clydin clydin added target: patch This PR is targeted for the next patch release target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release labels Oct 17, 2025
Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Charles!

@clydin clydin added the action: merge The PR is ready for merge by the caretaker label Oct 17, 2025
@clydin clydin merged commit ec739d7 into angular:main Oct 17, 2025
35 checks passed
@clydin clydin deleted the application/bazel-esbuild-env-var branch October 17, 2025 20:39
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: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants