Compiling multiple WASM modules from one Rust crate

Hi, I am trying to build a web application using the Yew Framework, and I am wondering how I can serve multiple HTML pages, each with their own WASM module. The main reason I want to do this is performance, because I don't want the browser to load all of the code for my app every time.

I would like to split the app up into different pages, each with their individual WASM module, and load them on demand. Each page can also route to different contents using the client-side yew_router, but this runs from one single index.html and requires to load the entire WASM code of the entire app.

So I would like to split my client side code up into individual modules, and I was wondering if I could compile one single crate into multiple standalone WASM modules, or if I do have to set up an individual crate for each page, and compile those to individual modules. This would propbably work, but would require some more infrastructure, so I was wondering if someone knew a better way.


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.