Allow transforming ESBuild configuration (@angular-devkit/build-angular:browser-esbuild) and align interface with the rest of builders
See original GitHub issueCommand
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
Issue Analytics
- State:
- Created a year ago
- Reactions:38
- Comments:7 (4 by maintainers)
In our case, we would just need “provide” as an option, so we can inject the build env, build date, app version and commit hash in our app.
Another one is using pug instead of html as the template language for our project. Basically pug transpiles into html so that angular can use it.
We currently use @angular-builders/custom-webpack for this.