Blame view

vite.config.ts 1.46 KB
1
import { defineApplicationConfig } from '@vben/vite-config';
Vben authored
2
3
4
export default defineApplicationConfig({
  overrides: {
sanmu authored
5
6
7
    // build: {
    //   sourcemap: 'inline',
    // },
vben authored
8
9
10
11
12
13
14
15
16
17
18
19
    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',
      ],
    },
vben authored
20
    server: {
21
      proxy: {
sanmu authored
22
23
24
25
        '/basic-api/order': {
          target: 'http://39.108.227.113:8010',
          // target: 'http://39.108.227.113:3000/mock/35',
          // http://39.108.227.113:8010/order/erp/captcha/get_img_captcha_code
26
27
28
          changeOrigin: true,
          ws: true,
          rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),
sanmu authored
29
30
31
32
33
34
35
36
37
        },
        '/api/localStorage/upload': {
          target: 'http://39.108.227.113:8010',
          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`), '');
          // },
38
39
40
41
42
43
44
45
          // only https
          // secure: false
        },
        '/upload': {
          target: 'http://localhost:3300/upload',
          changeOrigin: true,
          ws: true,
          rewrite: (path) => path.replace(new RegExp(`^/upload`), ''),
46
        },
47
      },
vben authored
48
    },
49
50
  },
});