import { defineConfig } from 'astro/config';
import react from '@astrojs/react';
import markdoc from '@astrojs/markdoc';
import keystatic from '@keystatic/astro';
import node from '@astrojs/node';

import preact from '@astrojs/preact';

// https://astro.build/config
export default defineConfig({
  output: 'static',
  integrations: [
    react(),
    markdoc(),
    preact(),
    ...(process.env.SKIP_KEYSTATIC ? [] : [keystatic()]),
  ],
  vite: {
    ssr: {
      noExternal: ['lodash'],
    },
    optimizeDeps: {
      include: ['react', 'react-dom', 'react/jsx-runtime'],
    },
  },
});
