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

export default defineConfig({
  plugins: [vue()],
  base: '/',
  resolve: {
    alias: {
      '@': resolve(__dirname, 'src')
    }
  },
  build: {
    chunkSizeWarningLimit: 2000,
    //outDir: resolve(__dirname, '../csy-ui/src/main/resources/static'),
    emptyOutDir: true
  },
  server: {
    host: true,
    port: 3000,
    proxy: {
      '/api': {
        target:'http://192.168.12.4:8888/', 
        //target:'http://192.168.12.230:8888',
        //target:'http://192.168.5.230:8888',
        //target:'http://192.168.5.232:8888/',
        //target:'http://localhost:8888',
        changeOrigin: true
      },
      '/druid': {
        target: 'http://localhost:8888',
        changeOrigin: true
      },
      '/ws': {
        target: 'ws://localhost:8888',
        ws: true,
        changeOrigin: true
      }
    }
  }
})
