https://github.com/module-federation/module-federation-examples
run yarn
at the repo root.
You can then run yarn && yarn start
from any of the non-proprietary examples.
Base Example
- Basic Host-Remote — App 1 consumes remote components from App2.
- Bi-Directional Hosts — App1 consumes App2 components; App2 consumes App1 components.
- Dynamic System Host — Swap between remotes at runtime.
- Share Context Provider — App1 and App2 with shared Context Provider.
- Shared Routes — Compose federated routes for a seamless user experience.
My Example
- Share-Dynamic-Routes — Shared Dynamic Routes.
- Dynamic-Menus — 点击菜单,动态加载远程模块(使用系统标志作转发,而非写死的资源访问地址)
yarn
cd basic-remotes-component
yarn start