If you were to have a second host app would it also need to be part of this repo/mono-repo?

An Angular monorepo or Workspace has the capability of having multiple application projects (there are (2) types of projects: application and library). Therefore, it is possible to have as many host application projects that you need. However, typically for a micro frontend scenario, you should only have a single host. The host application’s responsibility is to coordinate the loading of the different micro frontend “application” (a library project) projects to compose the features of the application.

Considering that the micro-app is a library, would it be possible/advised to publish it to a private npm repository and import it into a second host app in this lazy-loaded manner?

The short answer is no. You only need to publish the micro-app libraries if there are other applications outside of your monorepo/Workspace environment that will consume/use your micro-apps. This is an excellent way to share/reuse library projects. However, by default, the Angular Workspace allows for related projects to be in the same work environment — without the overhead of building, publishing, and consuming packages. This is the beauty of the Workspace. Effective and efficient. If you are using Nrwl.io Nx Workspace, you can create the library projects with the publishable option and they are ready for publishing to NPM.



I love tacos, code, jazz, my husky and maybe 3 people in this world...and of course: Angular. Angularlicious podcast — more info at www.AngularArchitecture.com

Love podcasts or audiobooks? Learn on the go with our new app.