You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configure module federation plugin directly on next config, set runtime to false in plugin - this will generate a self contained webpack runtime for the remote container.
For sharing react and other next internals, you cannot share react since it splits it out of the main bundle, but theres a trick that keeps it in place but still allows for sharing.
The key will not match so webpack wont chunk react out of main. Then we manually import it and specify the share key after the fact. This would stop the eager error on hosts when attempting to share react.
A similar solve could be possible for sharing next internals like script, head, link, router, dynamic.
The rest of the things you’d want to share can be as normal since you can put all pages behind an async bootstrap.
This would drastically reduce complexity and build speeds
The text was updated successfully, but these errors were encountered:
Configure module federation plugin directly on next config, set runtime to false in plugin - this will generate a self contained webpack runtime for the remote container.
For sharing react and other next internals, you cannot share react since it splits it out of the main bundle, but theres a trick that keeps it in place but still allows for sharing.
Fakereact: {
ShareKey: react,
Import: react,
Singleton:true
}
The key will not match so webpack wont chunk react out of main. Then we manually import it and specify the share key after the fact. This would stop the eager error on hosts when attempting to share react.
A similar solve could be possible for sharing next internals like script, head, link, router, dynamic.
The rest of the things you’d want to share can be as normal since you can put all pages behind an async bootstrap.
This would drastically reduce complexity and build speeds
The text was updated successfully, but these errors were encountered: