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

export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'),
    },
  },
  preview: {
    host: '0.0.0.0',
    port: 5173,
    allowedHosts: ['ai-swap.local'],
  },
  server: {
    proxy: {
      '/api': {
        target: 'http://localhost:8002',
        changeOrigin: true,
      },
      '/output': {
        target: 'http://localhost:8002',
        changeOrigin: true,
      },
      '/materials': {
        target: 'http://localhost:8002',
        changeOrigin: true,
      }
    }
  }
}); 