fix(react): fix target to use for serve-ssr remote detection (#13709)

This commit is contained in:
Colum Ferry 2022-12-08 13:32:17 +00:00 committed by GitHub
parent 3e933b6e24
commit 62fc986609
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,11 +4,11 @@ import { getModuleFederationConfig } from './utils';
function determineRemoteUrl(remote: string) {
const remoteConfiguration = readCachedProjectConfiguration(remote);
const serveTarget = remoteConfiguration?.targets?.serve;
const serveTarget = remoteConfiguration?.targets?.['serve-server'];
if (!serveTarget) {
throw new Error(
`Cannot automatically determine URL of remote (${remote}). Looked for property "host" in the project's "serve" target.\n
`Cannot automatically determine URL of remote (${remote}). Looked for property "host" in the project's "serve-server" target.\n
You can also use the tuple syntax in your webpack config to configure your remotes. e.g. \`remotes: [['remote1', '//localhost:4201']]\``
);
}