yangfeng
2023-07-19 23d80c1b64f23ede237ab8e89ebc2ee2aaf43f26
vue.config.js
@@ -3,17 +3,49 @@
//   transpileDependencies: true
// })
const path = require("path")
const getServerJson = require("./public/serverconfig")
const devServer = require("./vue.develop.config")
const { context } = getServerJson
// 基础路径 注意发布之前要先修改这里
const publicPath = "/"
function resolve(dir) {
  return path.join(__dirname, dir)
}
module.exports = {
  publicPath: context,
  publicPath,
  lintOnSave: false,
  productionSourceMap: false, // 如果你不需要生产环境的source map, 可以将其设置为false 以加速生产环境构建
  devServer,
  devServer: {
    proxy: {
      "/api/base": {
        target: "http://192.168.20.118:8001",
        ws: true,
        changeOrigin: true
      },
      "/api/salesLeads": {
        target: "http://192.168.20.118:8001",
        ws: true,
        changeOrigin: true
      },
      "/api/followRecord": {
        target: "http://192.168.20.118:8001",
        ws: true,
        changeOrigin: true
      },
      "/api-s": {
        target: "http://192.168.20.119:9081",
        ws: true,
        changeOrigin: true
      },
      "/api": {
        target: "http://192.168.20.118:8001",
        ws: true,
        changeOrigin: true
      }
      // "/api-s": {
      //   target: "http://192.168.20.113:9081",
      //   ws: true,
      //   changeOrigin: true,
      // },
    }
  },
  transpileDependencies: [
    // 兼容IE11浏览器(兼容npm包和cnpm包)
    "crypto-js",
@@ -50,5 +82,13 @@
        symbolId: "icon-[name]"
      })
      .end()
  },
  css: {
    loaderOptions: {
      // 设置 scss 公用变量文件
      sass: {
        additionalData: `@import "@/assets/style/variable.scss";`
      }
    }
  }
}