In our app, we use runtime dynamic linking using dlopen & FS.createLazyFile to load side modules lazily. But we have to maintain a cumbersome exported functions list in a text file for the functions which are required by side modules. This list is hard to maintain and we need to change it most of the times we update emscripten.
To solve this, I got to know that emscripten automatically exports all the imports of side modules on main module which seem pretty promising. But when I compiled and loaded my app, I saw all the side modules getting downloaded at app load itself. I dig into this to find out that emscripten checks all the dynamic libs in the custom section dylink.0 and download them at the start itself.
This defeats our purpose of lazily loading side module. What should be done in this case?