This plugin implements Module Federation 1.5.
implementation
string
runtimePlugins
string[]
name
string
filename
string
runtime
string | false
library
LibraryOptions
shareScope
string
"default"
.remoteType
ExternalsType
"script"
, which loads via the <script />
tag.remotes
exposes
shared
Type:
Usage: Specify which dependencies should be shared dependencies. This allows multiple micro-frontends to share the same instance of a dependency library to avoid loading the same code repeatedly. It can be an object dictionary where the keys are the names of the shared modules and the values are configuration or version strings. It can also be an array where the array items are the shared package names or configurations.
The SharedConfig can include the following sub-options:
true
, the shared module will be loaded in the initial chunk instead of being dynamically loaded when used. This means that the shared module will be loaded together with the main entry point regardless of whether it has been used. This can eliminate the delay caused by dynamic loading, but it will increase the size of the initial package. Also, please note that when this configuration is enabled, all provided modules and fallback modules will always be downloaded.package.json
. Configuration is only necessary when the package name cannot be automatically determined based on the request."^1.2.3"
. Used to set the version range of shared modules. If the module version of the remote container does not meet this range, the module will not be loaded."default"
.requiredVersion
. If set to true
, the shared module must match the version specified in requiredVersion exactly, otherwise an error will be reported and the module will not be loaded. If set to false
, it can tolerate imprecise matching.package.json
will be used.