It API option enables you to specify the working index to use into the build

It API option enables you to specify the working index to use into the build

They usually non-payments to the present doing work range of the method you’re having fun with to call esbuild’s API. The working directory can be used by the esbuild for a few some other one thing also resolving relative paths considering due to the fact API choices to absolute paths and you may fairly-print natural pathways because relative routes for the record texts. Here is how to override it:

#JS-specific info

Brand new node-established JS API is available in both synchronous and asynchronous styles, for each with various tradeoffs. You should understand variations to select this new right one for your state:

#Sync API

  • To avoid pledges can lead to vacuum code
  • Works in products that have to be parallel such as for instance inside want .extensions
  • You simply can’t use plugins towards the synchronous API since plugins is actually asynchronous
  • It reduces the present day thread you can’t do most other work for the time being
  • With the parallel API prevents esbuild out of parallelizing esbuild API calls

#Async API

  • You need plugins to your asynchronous API
  • The present day bond is not banned so you can create almost every other operate in the newest meantime
  • You might run many simultaneous esbuild API calls in addition which happen to be after that bequeath all over all readily available CPUs for maximum results
  • Using guarantees can lead to messier code, particularly in CommonJS where top-height expect is not available
  • Can not work into the issues that must definitely be parallel instance inside need .extensions

#Running in the browser

The fresh new esbuild API also can run in brand new internet browser playing with WebAssembly when you look at the a web site Personnel.READ MORE