A way to do dynamic imports in Vite

I just open sourced a solution we’re using for doing dynamic imports of ReScript modules in Vite: https://github.com/ArizonAB/vite-rescript-dynamic-import

More information is in the readme. Hoping someone might find this useful! We’ve been using it in production for well over a year.

It currently only has a regular module import example, but adding a React.lazy example as well should be straight forward and is something I plan to do soon.

9 Likes