Switch to using esbuild?

I think switching to using esbuild could massively improve build times. It is very straightforward to configure in comparison to using Webpack and has excellent support for TypeScript and ESM. It also is significantly more lightweight than Webpack.

cc @RaananW

esbuild is a wonderful bundler. But it is lacking in certain areas.
I am experimenting with turbopack (written in rust), which is also extremely fast. I hope to be able to move to a different system that is fully compatible with everything we are doing.

What part of esbuild is not compatible? A custom plugin can always be written if needed.

Well, when I analyzed the different packers available, there were a few issues with esbuild. Quickly looking, one of them is still an open issue - code splitting. It is also not running type-checking for typescript. This requires another step (which is fine), but this can be done with any other bundler (and it will accelerate build times in all others). Turbopack has the same issue. Back then esbuild was also just a pet project and wasn’t too actively developed. It’s also not very reassuring using version 0.18.X in production. But that’s just cosmetics.

I believe esbuild is great and does its job. We know webpack is slower, but we mostly use it on the CI which is an async-task for us. There is no true rush switching bundlers. For real-time, hot-reload development environment, webpack is fast enough and very reliable.

1 Like

Great points. I agree there is no rush – I was presenting the idea since I use it for my game. I use TypeScript with noEmit for type checking in addition to typescript-eslint.

1 Like