I would like to echo that I also would be in favour of having a way to transform a ReScript file to in-memory JavaScript. I mentioned this in Tighter Vite integration · rescript-lang/rescript-compiler · Discussion #6753 · GitHub, where I hint at an optimized Vite integration.
@hgiraud are you able to pull this off today using ninja?