An open API service indexing awesome lists of open source software.

https://github.com/module-federation/metro-mf


https://github.com/module-federation/metro-mf

Last synced: 12 months ago
JSON representation

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.