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

export default defineConfig({
  plugins: [vue()],
  build: {
    outDir: resolve(__dirname, 'dist'),
    emptyOutDir: true,
  },
  define: {
    'window.__API_BASE_URL__': JSON.stringify('/api')
  },
  server: {
    port: 5174,
    proxy: {
        '/api': {
            target: 'http://localhost:5173',
        changeOrigin: true,
        secure: false,
      },
    },
  },
})
