This is a bare minimum code demonstration of micro front ends using Webpack's ModuleFederationPlugin. It showcases how to create micro front ends and share a Redux state between applications.
Before getting started, ensure you have Node.js and npm installed.
npm run install
This command installs dependencies for the host, store, and nav applications.
npm run install:host
: Install host application dependencies.npm run install:store
: Install store application dependencies.npm run install:nav
: Install nav application dependencies.
To run the applications in development mode:
npm start
This command starts the applications in parallel.
npm run start:host
: Start the host application.npm run start:store
: Start the store application.npm run start:nav
: Start the nav application.
Visit http://localhost:3000 to view the micro front ends in action.
During development, you can run each application separately:
npm run start:host npm run start:store npm run start:nav
This allows you to work on individual micro front ends independently.
When ready to build for production:
npm run build
This command builds the applications in parallel.
npm run build:host
: Build the host application.npm run build:store
: Build the store application.npm run build:nav
: Build the nav application.
The production-ready files will be generated in the respective build
folders.
Contributions are welcome! Feel free to open issues or submit pull requests.
- Fork the repository.
- Create your feature branch:
git checkout -b feature/your-feature
. - Commit your changes:
git commit -am 'Add some feature'
. - Push to the branch:
git push origin feature/your-feature
. - Open a pull request.
This project is licensed under the MIT License.