import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import tailwindcss from '@tailwindcss/vite'
import { resolve } from 'path'

export default defineConfig({
  plugins: [vue(), tailwindcss()],
  resolve: {
    alias: {
      '@': resolve(__dirname, 'src'),
    },
  },
  server: {
    proxy: {
      '/api/proxy/minimax': {
        target: 'https://api.minimax.io',
        changeOrigin: true,
        secure: false,
        rewrite: (path) => path.replace(/^\/api\/proxy\/minimax/, '/v1/chat/completions'),
      },
      '/api': {
        target: 'https://kappa.lambdaanalytics.co',
        changeOrigin: true,
        secure: false,
      },
    },
  },
})
