Files
wehub-resource-sync bb5c75ce05
Component Security Validation / Security Audit (push) Has been cancelled
Deploy to Cloudflare Pages / deploy (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:38:58 +08:00

55 lines
1.3 KiB
YAML

# Static Site (React/Vue/Gatsby)
# SPA with client-side routing
services:
- type: web
name: react-app
runtime: static
plan: free
branch: main
autoDeploy: true
buildCommand: npm ci && npm run build
staticPublishPath: ./build # Change to ./dist for Vue/Vite, ./public for Gatsby
# SPA routing - rewrite all routes to index.html
routes:
- type: rewrite
source: /*
destination: /index.html
# Cache control headers
headers:
# Cache static assets aggressively
- path: /static/*
name: Cache-Control
value: public, max-age=31536000, immutable
# Cache other assets for 1 hour
- path: /assets/*
name: Cache-Control
value: public, max-age=3600
# Don't cache index.html
- path: /index.html
name: Cache-Control
value: no-cache, no-store, must-revalidate
# Security headers
- path: /*
name: X-Frame-Options
value: DENY
- path: /*
name: X-Content-Type-Options
value: nosniff
- path: /*
name: Referrer-Policy
value: strict-origin-when-cross-origin
# Environment variables for build (if needed)
envVars:
- key: REACT_APP_API_URL
value: https://api.example.com
# Add other REACT_APP_ or VITE_ variables here