esbuild icon indicating copy to clipboard operation
esbuild copied to clipboard

Building code to a variable

Open Kycermann opened this issue 2 years ago • 1 comments

Hi, I'm using esbuild progammatically like this:

esbuild.build({
   plugins: [],
   entryPoints: [input],
   outfile: output,
   bundle: true,
   minify: false,
})

Is it possible to return the results to a variable instead of outputting to a file?

If not, is it intentional?

Kycermann avatar Sep 15 '22 11:09 Kycermann

https://esbuild.github.io/api/#write

evanw avatar Sep 15 '22 12:09 evanw

Closing as there is nothing to be done here. Hopefully the documentation in the above link is sufficient.

evanw avatar Sep 18 '22 02:09 evanw

I came looking to open an issue requesting this and fortunately found this issue. I would have expected this to be mentioned in either https://esbuild.github.io/getting-started/#build-scripts or https://esbuild.github.io/api/#build-api or under the various out* options. I would appreciate some part of the docs where the JavaScript API is fully documented in one place, including the possible return values of build().

GeoffreyBooth avatar Nov 22 '22 17:11 GeoffreyBooth