MrShi
2023-12-22 6fa42e992669e6c1b5d4be14e83e1a730ec36c40
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
// 详细配置请参考https://cli.vuejs.org/zh/config/#vue-config-js
const outputDir = process.env.VUE_APP_CONTEXT_PATH.substring(1, process.env.VUE_APP_CONTEXT_PATH.length - 1)
module.exports = {
  publicPath: process.env.VUE_APP_CONTEXT_PATH,
  outputDir: outputDir === '/' ? 'dist' : outputDir,
  assetsDir: 'static',
  lintOnSave: false,
  devServer: {
    host: '0.0.0.0',
    port: 10012,
    proxy: {
      [process.env.VUE_APP_API_PREFIX]: {
        // http://192.168.0.130:10013
        // 192.168.0.110:10013  192.168.0.110:10013
        // http://192.168.0.101:10013
        // http://192.168.0.132:10013
        target: 'http://192.168.0.132:10013',
        changeOrigin: true,
        pathRewrite: {
          [`^${[process.env.VUE_APP_API_PREFIX]}`]: ''
        }
      }
    }
  }
}