fix: 完整修复 Vercel 部署配置
关键修复: - 设置 Node.js 版本为 18.x(Vercel 要求) - 排除 api/ 目录不被 TypeScript 编译 - 简化 vercel.json,让 Vercel 自动处理构建 - api/index.ts 作为独立 serverless 函数运行 技术说明: - Vercel 的 api/ 目录是特殊目录,自动识别为 serverless 函数 - api/index.ts 会被映射到 /api 路由 - src/ 目录正常编译到 dist/,供 api/index.ts 导入使用 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7f35617f64
commit
7185009c28
|
|
@ -6,7 +6,7 @@
|
|||
"private": true,
|
||||
"license": "UNLICENSED",
|
||||
"engines": {
|
||||
"node": "20.x"
|
||||
"node": "18.x"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npx nest build",
|
||||
|
|
|
|||
|
|
@ -17,5 +17,6 @@
|
|||
"strictBindCallApply": false,
|
||||
"forceConsistentCasingInFileNames": false,
|
||||
"noFallthroughCasesInSwitch": false
|
||||
}
|
||||
},
|
||||
"exclude": ["node_modules", "dist", "api"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,3 @@
|
|||
{
|
||||
"version": 2,
|
||||
"buildCommand": "pnpm run build",
|
||||
"functions": {
|
||||
"api/*.ts": {
|
||||
"runtime": "@vercel/node@2.15.10"
|
||||
}
|
||||
}
|
||||
"version": 2
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue