Skip to content

Commit 0622873

Browse files
committed
修改代码适配zeabur
1 parent fbc96bf commit 0622873

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

astro.config.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ import sentry from '@sentry/astro';
77
import spotlightjs from '@spotlightjs/astro';
88

99

10-
// 判断是否在 Zeabur 构建 (通过环境变量)
11-
const IS_ZEABUR = process.env.DEPLOY_PLATFORM === 'zeabur';
10+
// 判断是否在 Vercel 环境 (Vercel 平台自带此变量)
11+
const IS_VERCEL = process.env.VERCEL === '1';
1212

1313
export default defineConfig({
1414
// 开启 SSR (服务端渲染) 模式
1515
output: 'server',
1616

17-
// 动态选择适配器:
18-
// 如果是 Zeabur 就用 Node 模式,否则默认用 Vercel 模式
19-
adapter: IS_ZEABUR
20-
? node({ mode: 'standalone' })
21-
: vercel({}),
17+
// 逻辑反转:如果是 Vercel,用 Vercel 适配器;
18+
// 否则(Zeabur、本地、Docker),统统用 Node 适配器。
19+
adapter: IS_VERCEL
20+
? vercel({})
21+
: node({ mode: 'standalone' }),
2222

2323
// 启用 Svelte 支持
2424
integrations: [svelte(), sentry(), spotlightjs()],

0 commit comments

Comments
 (0)