Fix Vercel deployment to serve React client instead of server code

This commit is contained in:
Jeff Emmett 2025-06-19 12:57:39 +02:00
parent 536c1dddc3
commit 4b941ff318
2 changed files with 6 additions and 1 deletions

View File

@ -4,6 +4,7 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"build": "vite build", "build": "vite build",
"vercel-build": "vite build",
"dev": "vite", "dev": "vite",
"preview": "vite preview" "preview": "vite preview"
}, },

View File

@ -1,6 +1,6 @@
{ {
"version": 2, "version": 2,
"buildCommand": "cd client && npm install && npm run build", "buildCommand": "npm run build",
"outputDirectory": "client/dist", "outputDirectory": "client/dist",
"builds": [ "builds": [
{ {
@ -13,6 +13,10 @@
"src": "/api/(.*)", "src": "/api/(.*)",
"dest": "/server/index.ts" "dest": "/server/index.ts"
}, },
{
"src": "/assets/(.*)",
"dest": "/assets/$1"
},
{ {
"src": "/(.*)", "src": "/(.*)",
"dest": "/index.html" "dest": "/index.html"