feat(react): add skipRemotes option to module-federation-dev-server (#13090)
This commit is contained in:
parent
6bc3720656
commit
f08a3c3c44
@ -1385,6 +1385,11 @@
|
|||||||
"items": { "type": "string" },
|
"items": { "type": "string" },
|
||||||
"description": "List of remote applications to run in development mode (i.e. using serve target)."
|
"description": "List of remote applications to run in development mode (i.e. using serve target)."
|
||||||
},
|
},
|
||||||
|
"skipRemotes": {
|
||||||
|
"type": "array",
|
||||||
|
"items": { "type": "string" },
|
||||||
|
"description": "List of remote applications to not automatically serve, either statically or in development mode. This can be useful for multi-repository module federation setups where the host application uses a remote application from an external repository."
|
||||||
|
},
|
||||||
"buildTarget": {
|
"buildTarget": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Target which builds the application."
|
"description": "Target which builds the application."
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import {
|
|||||||
|
|
||||||
type ModuleFederationDevServerOptions = WebDevServerOptions & {
|
type ModuleFederationDevServerOptions = WebDevServerOptions & {
|
||||||
devRemotes?: string | string[];
|
devRemotes?: string | string[];
|
||||||
|
skipRemotes?: string[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export default async function* moduleFederationDevServer(
|
export default async function* moduleFederationDevServer(
|
||||||
@ -35,7 +36,10 @@ export default async function* moduleFederationDevServer(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const knownRemotes = moduleFederationConfig.remotes ?? [];
|
const remotesToSkip = new Set(options.skipRemotes ?? []);
|
||||||
|
const knownRemotes = (moduleFederationConfig.remotes ?? []).filter(
|
||||||
|
(r) => !remotesToSkip.has(r)
|
||||||
|
);
|
||||||
|
|
||||||
const devServeApps = !options.devRemotes
|
const devServeApps = !options.devRemotes
|
||||||
? []
|
? []
|
||||||
|
|||||||
@ -13,6 +13,13 @@
|
|||||||
},
|
},
|
||||||
"description": "List of remote applications to run in development mode (i.e. using serve target)."
|
"description": "List of remote applications to run in development mode (i.e. using serve target)."
|
||||||
},
|
},
|
||||||
|
"skipRemotes": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"description": "List of remote applications to not automatically serve, either statically or in development mode. This can be useful for multi-repository module federation setups where the host application uses a remote application from an external repository."
|
||||||
|
},
|
||||||
"buildTarget": {
|
"buildTarget": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Target which builds the application."
|
"description": "Target which builds the application."
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user