import { defineConfig } from "astro/config";
import sitemap from "@astrojs/sitemap";
import node from "@astrojs/node";
import path from "node:path";

const customOutDir = process.env.YINZHUANG_BUILD_OUT_DIR;

export default defineConfig({
  site: "https://www.inzung.cn",
  integrations: [sitemap()],
  adapter: node({ mode: "standalone" }),
  ...(customOutDir ? { outDir: path.resolve(customOutDir) } : {}),
  build: { format: "directory" },
  trailingSlash: "ignore",
});
