turborepo/examples at main ยท vercel/turborepo
Run the command
npx create-turbo@latest
Start Server
npm run dev
navigate to apps folder
Create a React Project
npm create vite@latest
Add ui as dependency to package.json in new react app
"@repo/ui": "*"
Add a turbo.json to the react folder to override the outputs object of this module
{
"extends": ["//"],
"tasks": {
"build": {
"outputs": ["dist/**"]
}
}
}
Initialize package.json
npm init -y
Initialize typescript
npx tsc --init
Edit tsconfig.json
{
"extends": "@repo/typescript-config/base.json",
"compilerOptions": {
"lib": ["ES2015"],
"rootDir": "./src",
"outDir": "./dist",
"module": "NodeNext",
},
"exclude": ["node_modules"],
"include": ["src"]
}
Add turbo.json
{
"extends": ["//"],
"tasks": {
"build": {
"env": ["PORT"],
"outputs": ["dist/**"]
}
}
}