-
-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(nextjs-mf): enable JSON manifest for NextJS #2726
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: b705fc8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Stale pull request message |
@ScriptedAlchemy I was looking forward on having that added to support MF2.0 |
Description
The NextJS plugins are not working with the MF 2.0 manifest because the publicPath is not properly generated on either the server or client. Additionally, adding
getPublicPath
causes the NextJS build to fail and I haven't been able to track down the root cause yet. These changes enhance the runtime plugin included with the NextJS MF plugin to reassign the publicPath to ensure that requests made after the initial manifest fetch are correctly resolved.Changing the manifest filePath in NextJS MF plugin results in the manifest file being output in the wrong location, and the manifest itself is generated based on relative paths to the output. So modifying it in the runtimePlugin is the simplest (though maybe not the most robust) approach. These changes don't cause existing remoteEntry.js configures to break.
Since there are no tests for the runtimePlugin, I didn't add any new ones. Happy to write some if someone can let me know where. I created a new example in the module-federation-examples repo to demo this: module-federation/module-federation-examples#4231
Please let me know what you think and if you would prefer a different approach.
Related Issue
#2673
Types of changes
Checklist