import { defineConfig } from '@vben/vite-config';
import vue from '@vitejs/plugin-vue';
import { compilerOptions } from 'vue3-pixi';

export default defineConfig(async () => {
  return {
    build:{
      target: 'esnext',
    },
    plugins: [
      vue({
        template: {
          // 移除未知元素警告
          compilerOptions,
          // 支持资源 URL 转换
        },
      }),
    ],
    application: {},
    vite: {
      server: {
        proxy: {
          '/api': {
            changeOrigin: true,
            rewrite: (path) => path.replace(/^\/api/, ''),
            // mock代理目标地址
            target: 'http://localhost:5320/api',
            ws: true,
          },
        },
      },
    },
  };
});
