This seems very interesting, thanks for sharing! I wonder if something similar could also be a usecase for Bun's macros, where certain code is executed at bundle time.[1]
This looks intresting! I haven't looked too much at Bun yet, I've been quite obsessed with Deno. Maybe I should take a look. Coming from Node and JS, its been such a great experience working with it.