Hi,
I’m trying to migrate a Connect app to Forge. My current app is composed with Vite.js and it has multiple entry points configured, so it produces several html files for different parts of the app.
For example, it produces an index.html
for the main interface, but then it builds a settings.html
for the settings page, and an options.html
for a Dialog modal.
When trying to migrate to Forge, the modules
section of the manifest must be pointed to a resource
key. But the resource
key must only be a directory. The intention here is for each resource
to be a different static app, but that would mean a lot of duplication, having several vite apps, and a huge overhead…
I’ve seen that there are hacks that detect the module loaded and some other data from view.getContext()
in order to load different apps or parts of the app, but the problem with this approach is that it generates one huge bundle that gets loaded every time. So all the code for the settings page gets loaded (but not used) on the main app and on the dialog modal app. Which is such a waste…
So… is there a way to cleanly point a resource
to a specific file? How would you resolve this?
Thanks!