1
wangjuncheng
6 天以前 5e54676db39cf138605a6c9e7d57edf7c6e860c4
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
const { defineConfig } = require('@vue/cli-service');
const path = require('path');
 
module.exports = defineConfig({
  runtimeCompiler: false,     //新增
  productionSourceMap: false, //新增
  transpileDependencies: true,
  configureWebpack: {
    resolve: {
      alias: {
        '@': path.resolve(__dirname, 'src')
      }
    }
  },
  //新增
  devServer: {
    port: 8080,
    open: true,
    host: '0.0.0.0',
    https: false,
    hot: true,
    proxy: {
      '/api': {
        target: 'http://192.168.37.60:8088',
        // target: 'http://192.168.1.104:8078',
        changeOrigin: true,
        // pathRewrite: {
        //   '^/api': ''
        // },
        secure: false
      },
      '/hp': {
        target: 'http://192.168.56.106:9533',
        changeOrigin: true,
        pathRewrite: {
          '^/hp': ''
        },
        secure: false
      },
      '/simu': {
        target: 'http://192.168.37.60:8088',
        changeOrigin: true,
        secure: false
      }
    }
  }
});