// @ts-check
import { defineConfig } from 'astro/config';
import vue from '@astrojs/vue';
import node from '@astrojs/node';
import tailwindcss from '@tailwindcss/vite';
import sitemap from '@astrojs/sitemap';

// PC7 — bascule SSR (mode 'server' Astro 6) pour endpoint /api/chatbot proxy.
// Toutes les pages publiques restent statiques via `export const prerender = true`.
// Coolify deploy (PC8) : `node ./dist/server/entry.mjs` (Node adapter standalone).
// PC8 — sitemap auto-genere + site URL pour canonical + redirects SEO.
export default defineConfig({
  site: 'https://trans-former.fr',
  output: 'server',
  adapter: node({ mode: 'standalone' }),
  integrations: [
    vue(),
    sitemap({
      filter: (page) => !page.includes('/api/'),
    }),
  ],
  vite: {
    plugins: [tailwindcss()],
  },
});
