Vercel Deployment Guide
Vercel is a modern frontend deployment platform that supports multiple frameworks and static sites. VUP projects provide two simple deployment methods.
Deployment Methods
Method 1: Local Deployment
Use the deployment commands in the project root directory:
bash
# Deploy to Vercel
pnpm deploy:prod
# Deploy preview version
pnpm deploy:preview
Method 2: GitHub Automatic Deployment
Connect GitHub Repository
- Import GitHub repository in Vercel console
- Select project root directory as deployment directory
Automatic Deployment
- Push to
main
branch automatically deploys to production - Push to other branches automatically generates preview links
- Push to
Project Configuration
The project root directory already includes a vercel.json
configuration file:
json
{
"version": 2,
"builds": [
{
"src": "apps/homepage/package.json",
"use": "@vercel/static-build",
"config": {
"distDir": "apps/homepage/.output"
}
}
],
"routes": [
{
"src": "/(.*)",
"dest": "/apps/homepage/.output/$1"
}
]
}
Environment Variables
Development Environment
Create .env.local
file:
bash
# .env.local
VITE_API_URL=https://api.example.com
VITE_APP_TITLE=My App
Production Environment
Set environment variables in Vercel console:
- Go to project settings
- Select "Environment Variables"
- Add variables and select environment
Custom Domain
- Go to project in Vercel console
- Select "Settings" > "Domains"
- Add custom domain
- Configure DNS records