Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webpack module federation using multiple git repos. Is there an example?

I am finding my way in the world of Webpack 5 module federation. There is a lot of good material and examples, like this and this.

However, all examples I found are built inside single Git repos, often using npm workspaces and/or nested package.json files.

Since I am going to implement module federation among multiple Git repositories, I'd like to see an example that does exactly that. Has anyone spotted such example?

I assume that the job is done in the definition of the remotes; I have seen some cases where the remote is defined through an URL, but in my case all remotes will be known at build time, so I guess an URL is overkill. Am I right?

like image 789
Marco Faustinelli Avatar asked May 02 '26 18:05

Marco Faustinelli


1 Answers

Yes, you don't have to mention the URL. I did not find any example handy but I tried following the same mono-repo example across two different repos. I did this:

On the micro-frontend app: output: { publicPath: '../[app-name]' }

On the shell-app: I used loadRemoteModule from '@angular-architects/module-federation'; just have to mention remoteEntry as the publicpath that you configured on MFE app so that it gets the remoteentry from there.

like image 198
vp310 Avatar answered May 04 '26 20:05

vp310



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!