just-jeb / angular-builders

Angular build facade extensions (Jest and custom webpack configuration)
MIT License
1.14k stars 199 forks source link

Custom ESBuild platform node #1789

Closed JeroenBoesten closed 2 months ago

JeroenBoesten commented 2 months ago

This is about the @angular-builders/custom-esbuild

Is your feature request related to a problem? Please describe. I’m trying to use the esbuilder to build a angular / electron application as described in https://github.com/maximegris/angular-electron/pull/810, the problem is when using node native modules like fs for example esbuild needs te platform to be set to node instead of browser (https://esbuild.github.io/getting-started/#bundling-for-node). As far as I can tell this is currently not possible yes change?

Describe the solution you'd like I think it would make sense to be able to set the platform along with the other builder options in the angular.json

Describe alternatives you've considered I did also search for alternative solutions and tried a lot of things without success, like changing the platform inside a plugin or adding the required node modules as externalDependencies.

JeroenBoesten commented 2 months ago

The problem ended up to be somewhere else.

just-jeb commented 2 months ago

Would be great if you shared the root cause and the solution in order to help others that encounter a similar issue.