-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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(react): add withModuleFederationForSSR function #13276
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
function determineRemoteUrl(remote: string) { | ||
const remoteConfiguration = readCachedProjectConfiguration(remote); | ||
const serveTarget = remoteConfiguration?.targets?.serve; | ||
|
||
if (!serveTarget) { | ||
throw new Error( | ||
`Cannot automatically determine URL of remote (${remote}). Looked for property "host" in the project's "serve" target.\n | ||
You can also use the tuple syntax in your webpack config to configure your remotes. e.g. \`remotes: [['remote1', '//localhost:4201']]\`` | ||
); | ||
} | ||
|
||
const host = serveTarget.options?.host ?? '//localhost'; | ||
const port = serveTarget.options?.port ?? 4201; | ||
return `${ | ||
host.endsWith('/') ? host.slice(0, -1) : host | ||
}:${port}/remoteEntry.js`; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaysoo This logic may need to change depending on how the server is launched (if the path to the server's location of remoteEntry.js
is not at the root URL for example).
e2b3aaa
to
779d4fc
Compare
779d4fc
to
f39be34
Compare
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
Module Federation is not supported in SSR
Expected Behavior
SSR should support Module Federation