Skip to content

Commit

Permalink
docs(examples): add missing step for building at repository root first (
Browse files Browse the repository at this point in the history
originjs#583)

This adds a step to some of the example README files for installing
dependencies and building at the repository root first.

I was running into the same issue as originjs#513 because I was following the
instructions exactly, not realizing that I needed to first install
dependencies and build at the repository root.

Fixes originjs#513.
  • Loading branch information
curtgrimes authored Mar 26, 2024
1 parent cfaa562 commit 3d29efe
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
9 changes: 6 additions & 3 deletions packages/examples/basic-host-remote/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
This repository is to showcase examples of how Module Federation can be used in rollup.

## Running Demo
First, `cd packages\examples\basic-host-remote`, then run `pnpm build` and `pnpm serve`. This will build and serve both `host` and `remote` on ports 5000, 5001 respectively.

- HOST (rollup-host): [localhost:5000](http://localhost:5000/)
- REMOTE (rollup-remote): [localhost:5001](http://localhost:5001/)
1. Clone [originjs/vite-plugin-federation](https://github.com/originjs/vite-plugin-federation) if you haven't already.
1. At the repository root, install dependencies (`pnpm install`) and build (`pnpm build`).
1. Go to this example folder: `cd packages\examples\basic-host-remote`
1. Run `pnpm install`, `pnpm build` and `pnpm serve` . This will build and serve both `host` and `remote` on ports 5000, 5001 respectively:
- HOST (rollup-host): [localhost:5000](http://localhost:5000/)
- REMOTE (rollup-remote): [localhost:5001](http://localhost:5001/)

`CTRL + C` can only stop the host server. You can run `pnpm stop` to stop all services.
5 changes: 4 additions & 1 deletion packages/examples/vue3-demo-esm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ This example demos consumption of federated modules from a vite bundle. `layout`

## Running Demo

First, `cd packages\examples\vue3-demo`, then run `pnpm build` and `pnpm serve` . This will build and serve `layout`, `home`, `common-lib` and `css-modules` on ports 5000, 5001, 5002, 5003 respectively.
1. Clone [originjs/vite-plugin-federation](https://github.com/originjs/vite-plugin-federation) if you haven't already.
1. At the repository root, install dependencies (`pnpm install`) and build (`pnpm build`).
1. Go to this example folder: `cd packages\examples\vue3-demo-esm`
1. Run `pnpm install`, `pnpm build` and `pnpm serve` . This will build and serve `layout`, `home`, `common-lib` and `css-modules` on ports 5000, 5001, 5002, 5003 respectively.

- HOST (layout): [localhost:5000](http://localhost:5000/)
- REMOTE (home): [localhost:5001](http://localhost:5001/)
Expand Down
14 changes: 8 additions & 6 deletions packages/examples/vue3-demo-systemjs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ This example demos consumption of federated modules from a vite bundle. `layout`

## Running Demo

First, `cd packages\examples\vue3-demo`, then run `pnpm build` and `pnpm serve` . This will build and serve `layout`, `home`, `common-lib` and `css-modules` on ports 5000, 5001, 5002, 5003 respectively.

- HOST (layout): [localhost:5000](http://localhost:5000/)
- REMOTE (home): [localhost:5001](http://localhost:5001/)
- REMOTE (common-lib): [localhost:5002](http://localhost:5002/)
- REMOTE (css-modules): [localhost:5003](http://localhost:5003/)
1. Clone [originjs/vite-plugin-federation](https://github.com/originjs/vite-plugin-federation) if you haven't already.
1. At the repository root, install dependencies (`pnpm install`) and build (`pnpm build`).
1. Go to this example folder: `cd packages\examples\vue3-demo-systemjs`
1. Run `pnpm install`, `pnpm build` and `pnpm serve` . This will build and serve `layout`, `home`, `common-lib` and `css-modules` on ports 5000, 5001, 5002, 5003 respectively:
- HOST (layout): [localhost:5000](http://localhost:5000/)
- REMOTE (home): [localhost:5001](http://localhost:5001/)
- REMOTE (common-lib): [localhost:5002](http://localhost:5002/)
- REMOTE (css-modules): [localhost:5003](http://localhost:5003/)

`CTRL + C` can only stop the host server. You can run `pnpm stop` to stop all services.

0 comments on commit 3d29efe

Please sign in to comment.