DEV Community

Discussion on: Lightning fast & simple Typescript Serverless builds

Collapse
hasnaindev profile image
Muhammad Hasnain

The image you share says that these bundlers were tested by bundling ten copies of three.js whereas what you share is some server-less build. Now, I don't claim to know much about server-less stuff, how can you compare these two things and rule out that esbuild is faster? Referring to bundling ten three.js files vs running a simple function.

Please help me understand. Thanks.

Collapse
tastefulelk profile image
Sebastian Bille Author

Hi Muhammad! The image I shared is from the benchmarks you can find in the link below. I haven't done any further performacne testing on esbuild vs webpack for bundling a serverless project but there's essentially no difference, this is just a way to plug the bundler into the deployment flow of Serverless Framework!

esbuild.github.io/faq/#benchmark-d...

Collapse
hasnaindev profile image
Muhammad Hasnain

Thanks. I was about to ask if esbuild supports code-splitting, HMR, front-end libraries support and other tools we're used to. Their roadmap has more detail on it but they aren't planning on adding those things except for code-splitting.

I'm pretty sure this tool might be have it's applications, albeit, somewhat rare or exceptional.

Thread Thread
astuyve profile image
AJ Stuyvenberg

HMR and front-end libs aren't generally needed for the purposes of the Serverless Framework and therefore this post.

But certainly worthwhile in the broader scheme of things. ES Build isn't a direct replacement for webpack generally, but in most serverless cases - it is.

Thread Thread
hasnaindev profile image
Muhammad Hasnain • Edited on

I agree. For these reasons, I don't think a esbuild's official comparison, such as above is meaningful.

Thread Thread
memark profile image
Magnus Markling

@hasnaindev you might want to look into the tool "Vite" if you're more interested in esbuild in a front-end context.