zhangxiao
2024-08-30 d50a7bc02d89e14beeab83a28f0d3677dbd9f0ef
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { mergeConfig } from 'vite';
import eslint from 'vite-plugin-eslint';
import baseConfig from './vite.config.base';
 
export default mergeConfig(
  {
    mode: 'development',
    publicPath: './',
    server: {
      open: true, // 项目启动后,自动打开
      fs: {
        strict: true,
      },
      proxy: {
        '/base': {
          // target: 'http://aiotlink.com:8189',
          target: 'http://192.168.20.116:8089',
          // target: 'http://192.168.20.158:8089',
          changeOrigin: true,
          ws: true,
          // rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),
          // only https
          // secure: false
        },
        '/api': {
          // target: 'http://aiotlink.com:8189',
          target: 'http://192.168.20.116:8089',
          // target: 'http://192.168.20.158:8089',
          changeOrigin: true,
          ws: true,
          // rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),
        },
        '/api/v1': {
          // target: 'http://aiotlink.com:8189',
          target: 'http://192.168.20.116:8089',
          // target: 'http://192.168.20.158:8089',
          changeOrigin: true,
          ws: true,
          // rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),
        },
      },
      // warmup: {
      //   clientFiles: ['./index.html', './src/{views,components}/*'],
      // },
    },
    plugins: [
      eslint({
        cache: false,
        // include: ['src/**/*.ts', 'src/**/*.tsx', 'src/**/*.vue'],
        include: [''],
        exclude: ['node_modules'],
      }),
    ],
  },
  baseConfig
);