Files
frontend_v2/astro.config.mjs
toom1996 335e264e45 update
2026-09-29 19:59:22 +08:00

48 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// @ts-check
import { defineConfig } from 'astro/config';
import { fileURLToPath } from 'node:url';
import tailwindcss from '@tailwindcss/vite';
import alpinejs from '@astrojs/alpinejs';
import node from '@astrojs/node';
// https://astro.build/config
export default defineConfig({
vite: {
plugins: [tailwindcss()],
resolve: {
alias: {
// 路径别名:@ -> 项目 src 目录(与 tsconfig paths 一致)
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
},
i18n: {
defaultLocale: 'en',
locales: ['en', 'cn'],
routing: {
prefixDefaultLocale: true, // 两种语言都带前缀:英文 /en/shows,中文 /cn/shows
},
},
integrations: [alpinejs()],
adapter: node({
mode: 'standalone'
}),
// 运行期 node server 监听地址(容器内部)。nginx 反代到该端口。
// host: true 监听 0.0.0.0,便于同容器内 nginx 以 127.0.0.1:3000 转发。
server: {
host: true,
port: 3000,
},
// base 地址配置已迁到 src/lib/config(dev/prod 两份 TS,缺则抛异常)。
// 仅「密钥」类仍走构建期 env(如 SSG_TOKEN),不在此声明,也不进客户端 bundle。
});