- Node.js version 22 (as specified in
.nvmrc
) - Corepack
In case Corepack is not available, you can install it manually:
npm install -g corepack
- Clone the repository with submodules:
git clone --recurse-submodules -j8 [email protected]:module-federation/metro-mf.git
- Navigate to the project directory:
cd metro-mf
- Enable Corepack and install dependencies in the monorepo:
corepack enable && corepack install && yarn install
- Navigate to the Metro submodule:
cd external/metro
- Set the correct Yarn version for Metro and install dependencies:
yarn set version 1.22.22 && yarn install
Set the METRO_FEDERATION_DEV
environment variable in your shell:
export METRO_FEDERATION_DEV=1
Then, run the development servers for both apps:
yarn dev
Note: You can freely make changes to both the
module-federation-metro
package (packages/module-federation-metro
) and themetro
packages (external/metro
). The dev server will automatically restart when changes are detected - there's no need to manually build either package.