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

const apiProxy = { '/api': { target: process.env.AMERC_API || 'http://127.0.0.1:5180', changeOrigin: true } };

export default defineConfig({
  plugins: [react()],
  server: { proxy: apiProxy },
  preview: { proxy: apiProxy },
  build: {
    chunkSizeWarningLimit: 800,
    rollupOptions: {
      output: {
        manualChunks: {
          three: ['three'],
        },
      },
    },
  },
});
