module-federation-examples
module-federation-examples copied to clipboard
feat(nextjs-mf): added nextjs-ssr-manifest example
This is a clone of the nextjs-ssr example, but it uses mf-manifest.json instead of remoteEntry.js. Requires changes from this PR: https://github.com/module-federation/core/pull/2726
This requires some CORS config to allow the manifest to be fetched from the browser. I just added the following to the NextJS config in each app, but there are other ways to do it:
// next.config.js
module.exports = {
headers() {
return [
{
source: '/_next/static/chunks/mf-manifest.json',
headers: [
{
key: 'Access-Control-Allow-Origin',
value: '*',
},
],
}
]
},
//...
}
Workflow status is failure ❌ Unfortunately test report wasn't generated, it can be if no workspaces changed. Please check the workflow run below. Link to GitHub workflow: Github Workflow Link