guonan
2025-04-22 dd527b7615517c53d7e4de92ae6cc87c18fa844c
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
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.56.107:8078',
        changeOrigin: true,
        // pathRewrite: {
        //   '^/api': ''
        // },
        secure: false
      },
      '/hp': {
        target: 'http://192.168.56.106:9511',
        changeOrigin: true,
        pathRewrite: {
          '^/hp': ''
        },
        secure: false
      }
    }
  }
});