Remotes
- Type:
PluginRemoteOptions - Required: No
- Default:
undefined - Usage: Used for consuming remote modules in
Module Federation
Tip
A parameter unique to consumers. If remotes is set, it can be considered that this is a consumer.
The PluginRemoteOptions type is as follows:
remoteAliasis the name actually used for reference by the consumer and can be configured as needed. For example, ifremoteAliasis set todemo, then the consumption method would beimport xx from 'demo'.ModuleFederationInfois composed ofModuleFederation name+@+ModuleFederation entryModuleFederation nameis the name set by the producerentrycan be eithermf-manifest.jsonorremoteEntry.js- When
entryismf-manifest.json, it has the following additional capabilities:- Dynamic module type hints
- Resource preloading
- Chrome devtool debugging tool
shareScope
- Type:
string | string[] - Required: No
- Default:
'default'
Defines which share scopes (shared dependency pools) the host aligns with a given remote. This is useful for isolating certain shared dependencies away from the default pool (for example, putting an internal design system into scope1 while keeping React in default).
Related configuration:
- The producer (remote) should declare which scopes it initializes via shareScope.
- Each shared dependency chooses its scope via shared.shareScope.