Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Configure and optimize Turborepo monorepo build pipelines with correct task structure, caching, and CI setup.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/ci/vercel.md
1# Vercel Deployment23Turborepo integrates seamlessly with Vercel for monorepo deployments.45## Remote Cache67Remote caching is **automatically enabled** when deploying to Vercel. No configuration needed - Vercel detects Turborepo and enables caching.89This means:1011- No `TURBO_TOKEN` or `TURBO_TEAM` setup required on Vercel12- Cache is shared across all deployments13- Preview and production builds benefit from cache1415## turbo-ignore1617Skip unnecessary builds when a package hasn't changed using `turbo-ignore`.1819### Installation2021```bash22npx turbo-ignore23```2425Or install globally in your project:2627```bash28pnpm add -D turbo-ignore29```3031### Setup in Vercel32331. Go to your project in Vercel Dashboard342. Navigate to Settings > Git > Ignored Build Step353. Select "Custom" and enter:3637```bash38npx turbo-ignore39```4041### How It Works4243`turbo-ignore` checks if the current package (or its dependencies) changed since the last successful deployment:44451. Compares current commit to last deployed commit462. Uses Turborepo's dependency graph473. Returns exit code 0 (skip) if no changes484. Returns exit code 1 (build) if changes detected4950### Options5152```bash53# Check specific package54npx turbo-ignore web5556# Use specific comparison ref57npx turbo-ignore --fallback=HEAD~15859# Verbose output60npx turbo-ignore --verbose61```6263## Environment Variables6465Set environment variables in Vercel Dashboard:66671. Go to Project Settings > Environment Variables682. Add variables for each environment (Production, Preview, Development)6970Common variables:7172- `DATABASE_URL`73- `API_KEY`74- Package-specific config7576## Monorepo Root Directory7778For monorepos, set the root directory in Vercel:79801. Project Settings > General > Root Directory812. Set to the package path (e.g., `apps/web`)8283Vercel automatically:8485- Installs dependencies from monorepo root86- Runs build from the package directory87- Detects framework settings8889## Build Command9091Vercel auto-detects `turbo run build` when `turbo.json` exists at root.9293Override if needed:9495```bash96turbo run build --filter=web97```9899Or for production-only optimizations:100101```bash102turbo run build --filter=web --env-mode=strict103```104