YangYuGang
2025-04-14 6a7257f9d8f659c508cf826726126c0fa4363eef
vite.config.ts
@@ -1,10 +1,12 @@
/*
 * @Description: file content
 * @Author: your name
 * @version:
 * @Date: 2024-06-17 14:51:26
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-06-18 18:06:29
 */
import { defineApplicationConfig } from '@vben/vite-config';
import topLevelAwait from 'vite-plugin-top-level-await';
import vueSetupExtend from 'vite-plugin-vue-setup-extend';
// export default defineConfig({
//   plugins: [vue(), vueSetupExtend()],
// });
export default defineApplicationConfig({
  overrides: {
@@ -27,7 +29,7 @@
      port: 3100,
      proxy: {
        '/basic-api': {
          target: 'http://localhost:9528',
          target: 'http://localhost:3000',
          changeOrigin: true,
          ws: true,
          rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),
@@ -41,14 +43,11 @@
          rewrite: (path) => path.replace(new RegExp(`^/upload`), ''),
        },
      },
      open: true, // 项目启动后,自动打开
      warmup: {
        clientFiles: ['./index.html', './src/{views,components}/*'],
      },
    },
    plugins: [
      topLevelAwait({
        promiseExportName: '__tla',
        promiseImportName: (i) => `__tla_${i}`,
      }),
      vueSetupExtend(),
    ],
    build: {
      target: 'esnext',
      rollupOptions: {