question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:38
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
muuvmuuvcommented, Nov 20, 2022

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.

1reaction
gabynevadacommented, Nov 17, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

FAQ - ESBuild
I'm hoping that plugins will allow the community to add major features (e.g. WebAssembly import) without needing to contribute to esbuild itself.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found