Commit deef079
fix(site-url): preview deploy 用 VERCEL_URL 兜底,避免 Vercel preview 构建炸
前一版改成 prod 无 NEXT_PUBLIC_SITE_URL 直接 throw,没考虑 Vercel preview/branch deploy 也跑在 NODE_ENV=production 里、且 Vercel project setting 里通常只给 prod 配 NEXT_PUBLIC_SITE_URL,所以 preview build 在 collect 阶段就被 _not-found 路由的 SITE_URL 求值炸掉。修法:检测 VERCEL_ENV=preview 时用系统注入的 VERCEL_URL(形如 myproject-git-branch-team.vercel.app),prod 仍 throw 不接受 VERCEL_URL 避免漏配静默用 *.vercel.app 域名。1 parent 0c40a35 commit deef079
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
48 | 57 | | |
49 | 58 | | |
50 | 59 | | |
| |||
0 commit comments