How to do code splitting with Reason (ReasonReact)?


I am trying use reasonml (ReasonReact specificallyl) for my toy project (a web application) and the experience so far is really great.
However, to be able to use it in production, I need a way to optimize the bundle build size. With normal react, we are using react-loadable and dynamic import and let webpack handle the splitting.
So what is the proper way to do code splitting with ReasonReact?


Well, the code is naturally split. Each file creates it’s own *.js for you. Submodules work the same way as well. I’ve used webpack for bundling, but more recently have moved over to Parcel.


I think he means the usage of the dynamic import statement in js where you can asynchronously load files.
I think there is no official way, yet. I am too very interested in this


There’s an open issue: