From 04d8e39c3d26f5b4ca32bef322c991f264ea2a9a Mon Sep 17 00:00:00 2001 From: liaoxinyu Date: Mon, 22 Sep 2025 20:05:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 1 + vue.config.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 vue.config.js diff --git a/manifest.json b/manifest.json index 4e1dcb0..365bb02 100644 --- a/manifest.json +++ b/manifest.json @@ -5,6 +5,7 @@ "versionName" : "1.0.0", "versionCode" : 100, "transformPx" : false, + "sassImplementationName": "node-sass", "app-plus" : { "compatible" : { "ignoreVersion" : true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持 diff --git a/vue.config.js b/vue.config.js new file mode 100644 index 0000000..c88b274 --- /dev/null +++ b/vue.config.js @@ -0,0 +1,15 @@ +module.exports = { + chainWebpack: (config) => { + // 发行或运行时启用了压缩时会生效 + config.optimization.minimizer('terser').tap((args) => { + const compress = args[0].terserOptions.compress + // 非 App 平台移除 console 代码(包含所有 console 方法,如 log,debug,info...) + compress.drop_console = true + compress.pure_funcs = [ + '__f__', // App 平台 vue 移除日志代码 + // 'console.debug' // 可移除指定的 console 方法 + ] + return args + }) + } +}