import react from '@vitejs/plugin-react-swc';
import vike from 'vike/plugin';
import { defineConfig } from 'vite';
import path from 'path';

export default defineConfig({
  plugins: [react(), vike()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'),
    },
  },
  build: {
    target: 'esnext',
  },
  server: {
    port: 1420,
    strictPort: true,
    host: true,
    hmr: {
      port: 24678,
    },
  },
  optimizeDeps: {
    include: ['react', 'react-dom', '@orchard9ai/design-system', 'zustand'],
  },
  ssr: {
    noExternal: ['@orchard9ai/design-system'],
  },
});