import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tailwindcss from '@tailwindcss/vite';
// import { visualizer } from "rollup-plugin-visualizer";
// https://vitejs.dev/config/
const isDev = process.env.NODE_ENV === 'development';

export default defineConfig({
  plugins: [react(), tailwindcss()],
  base: isDev ? '/' : './', //'/root/official/',
  optimizeDeps: {
    exclude: ['lucide-react'],
  },
  server: {
    proxy: {
      '/api': {
        target: 'http://localhost:4005',
        changeOrigin: true,
        secure: false,
        rewrite: (path) => path.replace(/^\/api/, '/api'),
      },
    },
  },
});
