2026-07-04 23:06:23 +00:00
|
|
|
import { readFileSync } from "node:fs";
|
2026-07-04 22:53:10 +00:00
|
|
|
import { defineConfig } from "astro/config";
|
2026-07-04 23:06:23 +00:00
|
|
|
|
|
|
|
|
const siteConfig = JSON.parse(
|
|
|
|
|
readFileSync(new URL("./src/config/site.json", import.meta.url)),
|
|
|
|
|
);
|
2026-07-04 22:53:10 +00:00
|
|
|
import mdx from "@astrojs/mdx";
|
|
|
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
|
|
|
|
|
|
|
|
const site =
|
2026-07-04 23:06:23 +00:00
|
|
|
process.env.SITE_URL || process.env.PUBLIC_SITE_URL || siteConfig.url;
|
2026-07-04 22:53:10 +00:00
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
site,
|
|
|
|
|
// astroagent overrides outDir for isolated preview builds (PREVIEW_OUT);
|
|
|
|
|
// falls back to the live output for normal/cron builds.
|
|
|
|
|
outDir: process.env.PREVIEW_OUT || "../public",
|
|
|
|
|
// For previews, PREVIEW_BASE prefixes asset paths (/_preview/<id>) so the
|
|
|
|
|
// preview is self-contained and doesn't pull _astro/fonts from the live site.
|
|
|
|
|
base: process.env.PREVIEW_BASE || undefined,
|
|
|
|
|
integrations: [mdx()],
|
|
|
|
|
vite: {
|
|
|
|
|
plugins: [tailwindcss()],
|
|
|
|
|
build: {
|
|
|
|
|
emptyOutDir: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
});
|