Skip to content
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

Try and remove sidecar build #10

Open
ScriptedAlchemy opened this issue Feb 28, 2022 · 0 comments
Open

Try and remove sidecar build #10

ScriptedAlchemy opened this issue Feb 28, 2022 · 0 comments

Comments

@ScriptedAlchemy
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant