From ad636b07ce496716446634e59bebee05ad668db5 Mon Sep 17 00:00:00 2001 From: user1 <10901603+no-distractions1@user.noreply.gitee.com> Date: 星期二, 25 六月 2024 16:25:48 +0800 Subject: [PATCH] 艺术戏剧(拖拽题测试) --- vue.config.js | 31 ++++++++++++++++++++++++++----- 1 files changed, 26 insertions(+), 5 deletions(-) diff --git a/vue.config.js b/vue.config.js index 9b41f49..8269352 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,7 +1,9 @@ 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: 'http://182.92.203.7:3007/books/book/3', - publicPath:'/books/book', + publicPath: process.env.VUE_APP_PUBLIC_PATH, transpileDependencies: true, lintOnSave: false, // devServer: { @@ -19,8 +21,27 @@ output: { library: `app-content`, libraryTarget: "umd", - chunkLoadingGlobal: `webpackJsonp_app-content`, + 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 @@ -32,8 +53,8 @@ .loader("change-prefix-loader") .options({ prefix: "el-", - replace: "gp-", + replace: "gp-" }) .end(); - }, + } }); -- Gitblit v1.9.1