This repository demonstrates an example of a micro frontends architecture using Vite and Module Federation. It consists of two main parts:
- Remote: An independently built and deployed micro frontend application.
- Host: A container application that dynamically loads and uses the remote micro frontend at runtime.
/remote
— Micro frontend app exposing modules using Vite's Module Federation plugin./host
— Host app consuming the remote modules at runtime.
To run the host app successfully, you first need to build and preview the remote app.
-
Build and preview the remote
cd remote yarn install yarn run build yarn run preview
-
Run the host while remote server is running
cd host yarn install yarn run dev