Developed by Jack Herrington, co-author of the "Practical Module Federation" book and technology-focused YouTuber.
create-mf-app is a tool that creates a Module Federation application, API server, or library based on one of multiple different templates.
This guide provides a comprehensive walkthrough on how to use the create-mf-app tool to create a Module Federation application and integrate it with Zephyr.
To execute npm package binaries, use the npx command as follows:
Choose a name for your application. Ensure you designate one host and at least one remote, choosing names that reflect their roles accordingly.
Select the type of application:
You may use the default port option:
We conducted tests using React, but other frameworks may also be compatible. See the Module Federation guide for more details on supported frameworks.
We prefer TypeScript, but Zephyr is compatible with both TypeScript and JavaScript.
Both CSS and Tailwind are viable options for styling:
While both packing options are viable, we strongly recommend Rspack for its performance. See benchmark of Rspack.
Installing Zephyr plugin:
For Rspack:
For Webpack:
Incorporate the Zephyr configuration into your existing setup by wrapping the current configuration object with Zephyr's functionality.
For Rspack, update your rspack.config.js:
Zephyr requires a Git repository to track your project. Follow these steps to set up your repository:
Build your application to deploy it with Zephyr:
During the build process, Zephyr will:
Your application will be automatically available at the provided Zephyr URL. Each deployment creates a new version of your application with its own permanent URL.
create-mf-appFor more insights on building micro-frontends with Module Federation, check out Jack Herrington's video tutorial.