import { defineConfig } from "astro/config";

import node from "@astrojs/node";
import sitemap from '@astrojs/sitemap';

const getSiteURL = () => {
  if (process.env.SITE_URL) {
    return `https://${process.env.SITE_URL}`;
  }
  return "http://localhost:4321";
};

export default defineConfig({
  site: getSiteURL(),

  security: { csp: true },

  image: {
    dangerouslyProcessSVG: true,
  },

  prefetch: true,

  integrations: [
    sitemap(),
  ],

  output: 'static',

  adapter: node({
    mode: 'standalone',
  }),
});
