import { defineConfig } from '@vben/vite-config';
import { resolve } from 'path';

export default defineConfig(async () => {
  return {
    application: {},
    vite: {
      resolve: {
        alias: {
          '@ant-design/icons-vue': resolve(__dirname, 'node_modules/@ant-design/icons-vue')
        }
      },
      server: {
        proxy: {
          '/api': {
            changeOrigin: true,
            rewrite: (path) => path.replace(/^\/api/, ''),
            target: 'http://127.0.0.1:9055/api',
            ws: true,
          },
        },
      },
    },
  };
});
