zhangzengfei
2022-06-08 182aed85616f7ac60d0ffb02e4feac5661b80e0c
vue.config.js
@@ -1,5 +1,6 @@
"use strict";
const glob = require("glob");
const { ExitStatus } = require("typescript");
const pages = {};
const IS_VENDOR = /[\\/]node_modules[\\/]/;
const pageVendor = {};
@@ -8,8 +9,34 @@
const timestamp = new Date().getTime();
const queryStr = `?v=${pkg.version}&t=${timestamp}`;
const basicApps = [
  "index",
  "ai",
  "analysisPower",
  "cameraAccess",
  "cameraVideo",
  "datapush",
  "desktop",
  "gb28181",
  "library",
  "search",
  "settings",
  "systemSettings",
];
const argv = process.env.npm_lifecycle_event;
glob.sync("./src/pages/**/main.ts").forEach((path) => {
  const chunk = path.split("./src/pages/")[1].split("/main.ts")[0];
  // 仅编译基础应用
  if (argv == "release") {
    let app = chunk.split("/");
    if (app.length < 0 || basicApps.indexOf(app[0]) < 0) {
      return;
    }
  }
  const chunk_vendor = `${chunk}-vendors`;
  const chunk_common = `${chunk}-common`;
  pages[chunk] = {
@@ -41,10 +68,11 @@
});
const serverUrl = "http://192.168.20.189:7009"; // 羊五//
// const serverUrl = "http://192.168.8.10:7009";
const serverUrl2 = "http://192.168.8.10:9000";
// const serverUrl = "http://192.168.20.10:7009";
// const serverUrl2 = "http://192.168.20.10:9000";
// const serverUrl = "http://192.168.20.117:7009";
//  const serverUrl = "http://192.168.8.10:7009";
//const serverUrl = "http://192.168.8.118:7009";
const iotdataServerUrl = "http://192.168.8.10:9000";
// const cir = require("circular-dependency-plugin");
@@ -93,7 +121,7 @@
      },
      "/data/api-v/app/findAllApp": {
        // target: '/',
        target: "http://localhost:8081/",
        target: "http://localhost:8080/",
        changeOrigin: true,
        pathRewrite: {
          "^/data/api-v/app/findAllApp": "apps.json",
@@ -130,7 +158,11 @@
        changeOrigin: true, //开启代理
      },
      "/iotdata": {
        target: serverUrl2,
        target: iotdataServerUrl,
        changeOrigin: true, //开启代理,
      },
      "/version": {
        target: serverUrl,
        changeOrigin: true, //开启代理,
      },
    },