Skip to content

Commit

Permalink
fix: react-vite example to be able to run locally (originjs#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmarkus authored Jul 1, 2023
1 parent 4378089 commit 56c1e36
Show file tree
Hide file tree
Showing 7 changed files with 378 additions and 26 deletions.
4 changes: 3 additions & 1 deletion packages/examples/react-vite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ This example demos consumption of federated modules from a vite bundle. `host` (

## Running

First, run `pnpm install`, then `pnpm run build` and `pnpm run serve`. This will build and serve both `host` and `remote` on ports 5000, 5001 respectively.
Install `pnpm` as per instructions provided [here](https://pnpm.io/installation)

Run `pnpm install`, then `pnpm run build` and `pnpm run serve`. This will build and serve both `host` and `remote` on ports 5000, 5001 respectively.

- HOST: [localhost:5000](http://localhost:5000/)
- REMOTE: [localhost:5001](http://localhost:5001/)
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/react-vite/host/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"@vitejs/plugin-react": "^3.0.0",
"vite": "^4.0.3"
"vite": "^4.3.2"
}
}
10 changes: 3 additions & 7 deletions packages/examples/react-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@
"name": "react-vite",
"private": true,
"version": "1.0.0",
"workspaces": [
"host",
"remote"
],
"scripts": {
"build": "pnpm --parallel --filter \"./**\" build",
"serve": "pnpm --parallel --filter \"./**\" preview",
"build": "pnpm --parallel --filter \"./**\" build",
"serve": "pnpm --parallel --filter \"./**\" preview",
"build:remotes": "pnpm --parallel --filter \"./remote\" build",
"serve:remotes": "pnpm --parallel --filter \"./remote\" serve",
"dev:hosts": "pnpm --filter \"./host\" dev",
"stop": "kill-port --port 5000,5001"
},
"devDependencies": {
"kill-port": "^2.0.1",
"@originjs/vite-plugin-federation": "^1.1.10"
"@originjs/vite-plugin-federation": "^1.2.3"
}
}

3 changes: 3 additions & 0 deletions packages/examples/react-vite/pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packages:
- "host"
- "remote"
2 changes: 1 addition & 1 deletion packages/examples/react-vite/remote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"@vitejs/plugin-react": "^3.0.0",
"vite": "^4.0.3"
"vite": "^4.3.2"
}
}
Loading

0 comments on commit 56c1e36

Please sign in to comment.