Skip to content

Try and remove sidecar build #10

Open
@ScriptedAlchemy

Description

@ScriptedAlchemy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions