Lazy load multiple aurelia apps on the page

Hi, I’m maintaining a large aurelia v1 codebase (~65 repos) where we load multiple app bundles on the same page (using CLI/requireJs). Each bundle is its own individual repo and build scripts. We have one common set of shared services we inject using a plugin into each repo. The root nodes/shells (aurelia-app) for each app is put on the page via a server side CMS. We don’t do any clientside routing.

I would like to transition to the latest v1 aurelia with a common webpack configuration and single build config if possible. I’ve set up a new project and starting to experiment.

I would like to load each app using some kind of lazy loading based off what aurelia-apps are on the page. Maybe manually bootstrapping with a loop? I’ve seen some examples for chunking with routing but I’m not doing any client side routing.

Any help would be great.

i think what you’re looking for is a microfrontends architecture, where a shell app hosts multiple childs loaded lazily, typically via the router but nothing holds you back to fire the import yourself whenever you like

take a look here for a sample for v1 and v2 Micro frontends with Aurelia - #8 by zewa666

1 Like