https://github.com/postor/mono-repo-typescript-vite-example
https://github.com/postor/mono-repo-typescript-vite-example
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/postor/mono-repo-typescript-vite-example
- Owner: postor
- License: mit
- Created: 2024-07-13T09:16:56.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-07-13T09:20:30.000Z (11 months ago)
- Last Synced: 2025-01-25T18:09:50.283Z (4 months ago)
- Language: TypeScript
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# monorepo example - typescript+vite+react
explore intuitive way of using monorepo
features:
- directly run/build, no need to build lib first
- all code linked to source cross packages in IDE (at least vscode works)## start
```
npm run start -w workspace-main# or
cd workspacce-main && npm run start
```## build your own
```
# ---- npm part ----
# init root
cd /path/to/project_root
npm init -y# init packages
npm init -w ./packages/a
npm init -w ./packages/b# install new dependency for package
npm i {pkg_name} -w ./packages/a -S# init dependency relation
npm i ./packages/b -w ./packages/a -S
# config main in package.json, example `src/index.tsx`# ---- typescript part ----
# shared config for `baseUrl`,`paths`,`references` at root level, refer `./tsconfig.json`
vi tsconfig.json# extend base config and add local config for packages, refer `./workspace-main/tsconfig.json`
vi ./packages/b/tsconfig.json```