YangYuGang
2025-04-14 6a7257f9d8f659c508cf826726126c0fa4363eef
vite.config.ts
@@ -1,9 +1,19 @@
/*
 * @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';
export default defineApplicationConfig({
  overrides: {
    optimizeDeps: {
      esbuildOptions: {
        target: 'esnext',
      },
      include: [
        'echarts/core',
        'echarts/charts',
@@ -19,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`), ''),
@@ -33,14 +43,13 @@
          rewrite: (path) => path.replace(new RegExp(`^/upload`), ''),
        },
      },
      open: true, // 项目启动后,自动打开
      warmup: {
        clientFiles: ['./index.html', './src/{views,components}/*'],
      },
    },
    plugins: [
      topLevelAwait({
        promiseExportName: '__tla',
        promiseImportName: (i) => `__tla_${i}`,
      }),
    ],
    build: {
      target: 'esnext',
      rollupOptions: {
        output: {
          manualChunks: {