https://github.com/module-federation/metro-mf
https://github.com/module-federation/metro-mf
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/module-federation/metro-mf
- Owner: module-federation
- License: mit
- Created: 2025-04-17T14:11:13.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-19T11:34:00.000Z (12 months ago)
- Last Synced: 2025-06-20T22:35:33.083Z (12 months ago)
- Language: TypeScript
- Size: 2.83 MB
- Stars: 24
- Watchers: 7
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# metro-mf
## Getting Started
### Prerequisites
- Node.js version 22 (as specified in `.nvmrc`)
- Corepack
In case Corepack is not available, you can install it manually:
```bash
npm install -g corepack
```
### Setup Steps
1. Clone the repository with submodules:
```bash
git clone --recurse-submodules -j8 git@github.com:module-federation/metro-mf.git
```
2. Navigate to the project directory:
```bash
cd metro-mf
```
3. Enable Corepack and install dependencies in the monorepo:
```bash
corepack enable && corepack install && yarn install
```
4. Navigate to the Metro submodule:
```bash
cd external/metro
```
5. Set the correct Yarn version for Metro and install dependencies:
```bash
yarn set version 1.22.22 && yarn install
```
## Development
Set the `METRO_FEDERATION_DEV` environment variable in your shell:
```bash
export METRO_FEDERATION_DEV=1
```
Then, run the development servers for both apps:
```bash
yarn dev
```
> **Note:** You can freely make changes to both the `module-federation-metro` package (`packages/module-federation-metro`) and the `metro` packages (`external/metro`). The dev server will automatically restart when changes are detected - there's no need to manually build either package.