Vite
- Can build modules that meet the
Module Federationloading specifications. - Can consume modules that adhere to the
Module Federationspecifications using aliases. - Can configure shared dependencies for modules, so that when the host environment of the loaded module already has the corresponding dependency, it will not be loaded again.
- When a module has remote types, it automatically downloads and consumes the remote types.
Unsupported Options
Except for the dev option, all options are supported.
- roadmap 🗓️
- Consuming remote modules will have hot update capabilities.
- nuxt ssr
Quick Start
Installation
You can install the plugin with the following commands:
Register the Plugin
In Vite, you can add the plugin through the plugins configuration item in the vite.config.js file:
vite.config.js
Configure the Build Plugin
-
Type:
ModuleFederationPlugin(options: ModuleFederationOptions) -
The configuration structure for the Module Federation plugin is as follows:
You can find detailed explanations of all configuration items on the Configuration Overview page.