wangjuncheng
2025-04-17 c7ee7ba7f3c295743f4f2d72ae82e2390bf8bfd4
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.1.106:8079',
        changeOrigin: true,
        pathRewrite: {
          '^/api': '' 
        },
        secure: false 
      },
      '/hp': {
        target: 'http://192.168.56.106:9511',
        changeOrigin: true,
        pathRewrite: {
          '^/hp': ''
        },
        secure: false
      }
    }
  }
});