We don't use esbuild's "bundle" (--bundle) option, which means that our files get processed one-by-one and end up as separate files in the `dist` directory that we output to and that dependencies aren't processed at all and are just `required` like normal by our transpiled code.
Our build command (in a bash script file to avoid string escaping issues) is:
Thanks for sharing, I’ve just given it a go with one of my larger projects and WOW!! Typescript incremental compilation was taking around 2 seconds on every save, then Nodemon would restart etc.
I’ve plugged in Esbuild, I have used bundle mode though to see what it’s like, it works fine if I external all of my node modules, it builds in 0.23 seconds (approx 350 source files in my project).
Nodemon now watches for TS file changes and exec’s the esbuild on every start.
Thank you for the pointer to this as this will be a much needed productivity boost!
I’ll try bundling some node modules when I have some time but it will take more work as I use Yarn PnP (I’ve found a plug-in so will definitely try that)
Our build command (in a bash script file to avoid string escaping issues) is: