Blame view

vite.config.ts 2.69 KB
1
import { defineApplicationConfig } from '@vben/vite-config';
柏杨 authored
2
import { getAppEnvConfig } from '/@/utils/env';
Vben authored
3
柏杨 authored
4
// const { VITE_ALIYUN_OSS_DOMAIN } = getAppEnvConfig();
5
6
export default defineApplicationConfig({
  overrides: {
sanmu authored
7
8
9
    // build: {
    //   sourcemap: 'inline',
    // },
vben authored
10
11
12
13
14
15
16
17
18
19
20
21
    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
22
    server: {
23
      proxy: {
柏杨 authored
24
        '/aliyun-oss-pdf': {
柏杨 authored
25
          target: 'https://alterego.oss-cn-qingdao.aliyuncs.com',
柏杨 authored
26
27
28
29
30
31
          changeOrigin: true,
          secure: true, // 确保使用 HTTPS
          rewrite(path) {
            return path.replace(/^\/aliyun-oss-pdf/, '');
          },
        },
sanmu authored
32
        '/basic-api/order': {
柏杨 authored
33
          target: 'http://47.104.8.35:18000',
柏杨 authored
34
          // target: 'http://localhost:18000',
柏杨 authored
35
36
37
38
39
40
41
42
43
          // 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`), ''),
        },
        '/basic-api/project': {
柏杨 authored
44
          target: 'http://47.104.8.35:18000',
柏杨 authored
45
          // target: 'http://localhost:18000',
46
          // target: 'http://39.108.227.113:8000',
47
          // target: 'http://localhost:8000',
sanmu authored
48
          // target: 'http://39.108.227.113:3000/mock/35',
sanmu authored
49
          // http://39.108.227.113:8000/order/erp/captcha/get_img_captcha_code
50
51
52
          changeOrigin: true,
          ws: true,
          rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),
sanmu authored
53
54
        },
        '/api/localStorage/upload': {
柏杨 authored
55
          target: 'http://47.104.8.35:18000',
柏杨 authored
56
          // target: 'http://localhost:18000',
57
58
          // target: 'http://39.108.227.113:8000',
          // target: '192.168.31.250:18000',
59
          // target: 'http://localhost:8000',
sanmu authored
60
61
62
63
64
65
          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`), '');
          // },
66
67
68
69
          // only https
          // secure: false
        },
        '/upload': {
70
          // target: 'http://localhost:3300/upload',
71
72
73
74
          target: 'http://localhost:3300/upload',
          changeOrigin: true,
          ws: true,
          rewrite: (path) => path.replace(new RegExp(`^/upload`), ''),
75
        },
76
      },
vben authored
77
    },
78
79
  },
});