vite.config.ts 1.83 KB
import { defineApplicationConfig } from '@vben/vite-config';

export default defineApplicationConfig({
  overrides: {
    // build: {
    //   sourcemap: 'inline',
    // },
    optimizeDeps: {
      include: [
        'echarts/core',
        'echarts/charts',
        'echarts/components',
        'echarts/renderers',
        'qrcode',
        '@iconify/iconify',
        'ant-design-vue/es/locale/zh_CN',
        'ant-design-vue/es/locale/en_US',
      ],
    },
    server: {
      proxy: {
        '/basic-api/order': {
          // target: 'http://47.104.8.35:18000',
          target: 'http://localhost:8000',
          // target: 'http://39.108.227.113:8000',
          // target: 'http://localhost:8000',
          // target: 'http://39.108.227.113:3000/mock/35',
          // http://39.108.227.113:8000/order/erp/captcha/get_img_captcha_code
          changeOrigin: true,
          ws: true,
          rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),
        },
        '/api/localStorage/upload': {
          // target: 'http://47.104.8.35:18000',
          target: 'http://localhost:8000',
          // target: 'http://39.108.227.113:8000',
          // target: '192.168.31.250:18000',
          // target: 'http://localhost:8000',
          changeOrigin: true,
          ws: true,
          // rewrite: (path) => {
          //   console.log('%c [ path ]-32', 'font-size:13px; background:pink; color:#bf2c9f;', path);
          //   return path.replace(new RegExp(`^/basic-api`), '');
          // },
          // only https
          // secure: false
        },
        '/upload': {
          // target: 'http://localhost:3300/upload',
          target: 'http://localhost:3300/upload',
          changeOrigin: true,
          ws: true,
          rewrite: (path) => path.replace(new RegExp(`^/upload`), ''),
        },
      },
    },
  },
});