New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] JS API #77
Comments
I'm assuming you're intending for the API to be a thin wrapper around |
At least for the wasm case, wouldn't a wrapper around async function esbuildStartWorker be more performant in light of the overhead of exec'ing a process for each call? |
No, unfortunately not. The WebAssembly build is around 10x slower than the native build. I assume it's at least some combination of being single-threaded, JIT warm-up, and the lack of a parallel GC. As the comment at the top of browser.js says, that file only exists to make it possible to run in the browser. It's not at all designed to be fast. |
I'm surprised that wasm is 10X slower than native. I vaguely recall reading when it was announced that it was purported to be only 2X slower, although I could be mistaken. I understand the initial JIT warm up is slow, but once that one-time cost is paid shouldn't all subsequent wasm esbuild invocations be considerably faster? |
I was trying to use esbuild with
svelte
. The procedure is like this:*.svelte
to*.js
entry.js
tobundle.js
I am writing a transpiler to do these tasks.
Step 1 was achieved by using the API
svelte.compile
, but step 2 has to be achieved by using CLI:esbuild --bundle --outfile bundle.js entry.js
.I was hoping
esbuild
could provide an API so I can create the transpiler in a JavaScript file.The text was updated successfully, but these errors were encountered: