This repository showcases a Micro-Frontend implementation using RsPack, a high-performance bundler for JavaScript and TypeScript applications.
Micro-Frontends enable you to break down a large frontend application into smaller, independently deliverable units. This demo leverages RsPack’s blazing-fast build capabilities to demonstrate:
- Sharing components between micro-frontends.
- Independent builds for each micro-frontend.
- A seamless user experience with dynamic module federation.
- Micro-Frontend Architecture: Modularize your frontend into independently deployed applications.
- Dynamic Module Federation: On-the-fly loading of shared components and dependencies.
- Blazing Performance: Build and serve using RsPack for faster iteration.
Ensure you have the following installed on your system:
- Node.js (version 20 or higher)
- npm or yarn
Run the following command to install the required dependencies for all micro-frontends:
npm install
Run the following command to start the demo application:
npm run start
Each micro-frontend will be served locally, and the host application will combine them seamlessly.
To build the micro-frontends for production, use:
npm run build
The production-ready assets will be output to the dist/
directory.
- Independent Micro-Frontends: Each micro-frontend is a standalone application with its own RsPack configuration.
- Module Federation: The host app dynamically loads remote modules from each micro-frontend.
- Shared Components: Common dependencies (e.g., React) and utilities are shared to minimize duplication.
npm run start
: Starts the development servers for all micro-frontends and the host application.npm run build
: Builds the production-ready assets.npm run lint
: Lints the codebase.
- RsPack: Fast and efficient JavaScript bundler.
- React: For building user interfaces.
- Module Federation: For implementing micro-frontends.
Contributions are welcome! If you find any bugs or have feature requests, feel free to open an issue or submit a pull request.
- Fork the repository.
- Create a feature branch (
git checkout -b feature-name
). - Commit your changes (
git commit -m 'Add feature-name'
). - Push to the branch (
git push origin feature-name
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
Special thanks to the RsPack team for creating a fantastic bundler and to the community for inspiring micro-frontend architectures and to https://github.com/RussellCanfield for his tutorials and example implementations.
- Add Wasm examples
- Include other bundles
Happy coding! 🚀