I'm trying to use module federation (webpack 5) beetween nextjs applications. I started from this example (two nextjs applications) and everything works as expected. From my point of view the problem is that this works only if i have both app on the same host. The relevant webpack configuration part on next.config.js is below (the same in the other app)
....
remotes: {
next1: isServer
? path.resolve(
__dirname,
"../next1/.next/server/static/runtime/remoteEntry.js"
)
: "next1",
},
...
If i just remove the server configuration it doesn't works.
It is possible to use module federation between nextjs app without configure the remote server by folder path and reference the remote app only by url ?