1import { defineConfig } from "astro/config";
2
3import { LOCALES } from "./src/i18n/locales.ts";
4
5// Astro loads env with an empty prefix, and under `vp run` Vite+'s loadEnv then reports every
6// variable to the task cache. Any env difference (TERM, VP_RAW_SUBCOMMAND, an agent's session
7// vars) would rerun `astro check`. Without the runner client, loadEnv reads process.env directly;
8// file tracking does not use this client.
9delete process.env.VP_RUN_NODE_CLIENT_PATH;
10
11export default defineConfig({
12 site: "https://t3.codes",
13 // Vercel 308s `/path/` to `/path` (see vercel.ts), so every internal link and canonical uses one form.
14 trailingSlash: "never",
15 // English stays unprefixed at `/`; see src/i18n/locales.ts for each locale's URL segment.
16 i18n: {
17 defaultLocale: "en",
18 locales: LOCALES.map(({ code, path }) =>
19 !path || path === code ? code : { path, codes: [code] },
20 ),
21 routing: { prefixDefaultLocale: false },
22 },
23 server: {
24 port: Number(process.env.PORT ?? 4173),
25 },
26});