liudong
2024-07-26 b308f037bb6f1365c51b367ed4db5f8372febc90
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
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: {
        '/basic-api': {
          target: 'http://localhost:3000',
          changeOrigin: true,
          ws: true,
          // rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),
          // only https
          // secure: false
        },
        '/api/v1': {
          // target: 'http://192.168.20.116:1080/',
          target: 'http://aiotlink.com:8189',
          changeOrigin: true,
          ws: true,
          // rewrite: (path) => path.replace(new RegExp(`^/upload`), ''),
        },
      },
      // warmup: {
      //   clientFiles: ['./index.html', './src/{views,components}/*'],
      // },
    },
    plugins: [
      eslint({
        cache: false,
        // include: ['src/**/*.ts', 'src/**/*.tsx', 'src/**/*.vue'],
        include: [''],
        exclude: ['node_modules'],
      }),
    ],
  },
  baseConfig
);