Deployment Options
Deploy your React app to various hosting platforms. Learn about build optimization, environment variables, and CI/CD pipelines.
🌐 Vercel Deployment
# Install Vercel CLI
npm install -g vercel
# Deploy
vercel
# Production deployment
vercel --prod
# Or use GitHub integration:
# 1. Push code to GitHub
# 2. Connect repo in Vercel dashboard
# 3. Auto-deploy on every push📦 Build for Production
# Vite
npm run build
# Creates /dist folder with optimized files
# Test production build locally
npm run preview
# Environment variables
# .env.production
VITE_API_URL=https://api.myapp.com
VITE_GA_ID=UA-XXXXXXXX-X🎯 Key Takeaways
- Vercel: Zero-config deployment for React
- Netlify: Another great hosting option
- Build: Always optimize for production
- Environment variables: Use .env files
- CI/CD: Automate deployments with GitHub Actions
- CDN: Serve static assets globally