Skip to content

Allow transforming ESBuild configuration (@angular-devkit/build-angular:browser-esbuild) and align interface with the rest of builders #24163

@arturovt

Description

@arturovt

Command

build

Description

The @angular-devkit/build-angular:browser-esbuild builder is missing the ability to transform the ESBuild configuration as it's done in @angular-devkit/build-angular:browser. The executeBrowserBuilder function from the @angular-devkit/build-angular:browser builder accepts the transforms object as an optional argument at the end with the webpackConfiguration property. This allows many packages, such as @angular-builders/custom-webpack, to extend the Webpack configuration and then call executeBrowserBuilder at the end.

Describe the solution you'd like

The buildEsbuildBrowser function could have a third transforms argument with properties like esbuildConfiguration (like transforms.webpackConfiguration) and have a type of ExecutionTransformer<esbuild.BuildOptions>. This will basically pass the base configuration into the transformer and allow customizing it, then pass the configuration back to bundleCode -> esbuild.build.

That would align the builder interface with the rest of builders (:browser, :server, :karma, and extract-i18n).

Describe alternatives you've considered

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions