import { defineConfig } from 'vite';

export default defineConfig({
  // Base public path
  base: './',
  
  // Development server configuration
  server: {
    port: 5173,
    open: true, // Auto-open browser
    host: true, // Listen on all addresses
  },
  
  // Preview server configuration
  preview: {
    port: 5174,
    open: true,
  },
  
  // Build configuration
  build: {
    outDir: 'dist',
    assetsDir: 'assets',
    sourcemap: false, // Disable source maps in production
    minify: 'terser',
    terserOptions: {
      compress: {
        drop_console: true, // Remove console.logs in production
        drop_debugger: true,
      },
    },
    rollupOptions: {
      output: {
        manualChunks: undefined, // Single chunk for small app
      },
    },
  },
  
  // CSS configuration
  css: {
    postcss: './postcss.config.js',
  },
});
