import { sveltekit } from '@sveltejs/kit/vite';

/** @type {import('vite').UserConfig} */
const config = {
  plugins: [sveltekit()],
  server: {
    host: '0.0.0.0',
    port: 3000,
    strictPort: true,
    watch: {
      usePolling: true
    }
  },
  // better-sqlite3 is native — keep it out of Vite's optimizer
  ssr: {
    noExternal: [],
    external: ['better-sqlite3']
  },
  optimizeDeps: {
    exclude: ['better-sqlite3']
  }
};

export default config;
