Open svi3c opened 1 month ago
Java Script Code is bundled with the binary which itself is pretty big and means that you do not need to have bun installed on the target system. I am strongly in favour of a feature to strip as many modules as possible, but I am not sure if the bun project itself is really the way to go or if this would need to be a dedicated fork.
I wish I could use typescript for embedded development but the compiled bundle just doesn't fit on the tiny devices (maybe oven-sh project bread-roll ?)
What is the problem this feature would solve?
The resulting bundle size of the
bun build --compile
command is very large. With Bun 1.1.30, for a hello world program it's already 57MB, targetingbun-darwin-arm64
. The program consists of a single file:The command I used:
This means that the bundled runtime itself has to be very large.
What is the feature you are proposing to solve the problem?
I'm not sure what is included in the runtime for the single-file executables. There are many features included in Bun that are great for the DX, but not needed at execution time in production, e.g. bundling, testing, package management, etc. Also runtime APIs like
bun:sqlite
, and maybe also node APIs are not needed, unless they are explicitly used.What alternatives have you considered?
No response