Module Federation is a JavaScript application partitioning architecture pattern (similar to microservices on the server side) that allows you to share code and resources between multiple JavaScript applications (or micro frontends). This document is aimed at beginner users and will guide you through setting up the basic environment for Module Federation.
Before we begin, we require you to have the following prerequisites. For any unfamiliar terms encountered in the text, please refer to the Glossary of Terms:
Before starting to use Module Federation, you need to install Node.js and ensure that the Node.js version is >= 16. We recommend using the LTS version of Node.js 20.
You can check the current Node.js version in use with the following command:
If you do not have Node.js installed in your current environment, or if the installed version is too low, you can install the required version through nvm or fnm.
Here is an example of installing the LTS version of Node.js 20 with nvm:
To use Module Federation, you need to follow these steps:
For more information and advanced configuration options, please refer to the Build Configuration documentation.