From 3b007133606baceaca08ada046ca671f92c3f05a Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期一, 17 二月 2025 16:47:16 +0800
Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/testbookLayout

---
 vue.config.js |   37 +++++++++++++++++++++++++++++++++++--
 1 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/vue.config.js b/vue.config.js
index 8078cb6..8269352 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -1,14 +1,47 @@
 const { defineConfig } = require("@vue/cli-service");
+const webpack = require("webpack");
+// 鑾峰彇鎵�鏈変功绫嶅垪琛�
+const bookList = process.env.VUE_APP_BOOK_LIST ? process.env.VUE_APP_BOOK_LIST.split("/") : [];
 module.exports = defineConfig({
-  publicPath: "./",
+  publicPath: process.env.VUE_APP_PUBLIC_PATH,
   transpileDependencies: true,
   lintOnSave: false,
+  // devServer: {
+  //   open: true,
+  //   historyApiFallback: true,
+  //   allowedHosts: "all",
+  //   headers: {
+  //     "access-control-allow-origin": "*",
+  //   },
+  //   client: {
+  //     overlay: { warnings: false, errors: true }
+  //   }
+  // },
   configureWebpack: {
     output: {
       library: `app-content`,
       libraryTarget: "umd",
       chunkLoadingGlobal: `webpackJsonp_app-content`
-    }
+    },
+    plugins: [
+      new webpack.IgnorePlugin({
+        checkResource(resource) {
+          if (process.env.VUE_APP_ENV == "product") {
+            // 缂栬瘧鍜屾墦鍖呰繃婊�
+            for (let i = 0; i < bookList.length; i++) {
+              const bookName = bookList[i];
+              if (bookName != process.env.VUE_APP_BOOK_ID) {
+                // 杩囨护涓嶉渶瑕佺殑妯″潡
+                if (resource.indexOf(bookName) > -1) {
+                  return true;
+                }
+              }
+            }
+          }
+          return false;
+        }
+      })
+    ]
   },
   chainWebpack: (config) => {
     config.module

--
Gitblit v1.9.1