From 69120ebf05f5b7bbacfb19d8e3d16ef518124e97 Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Wed, 24 May 2023 16:45:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E9=99=A4console?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vue.config.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vue.config.js b/vue.config.js index 8532faf..e825b6c 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,6 +1,13 @@ const { defineConfig } = require("@vue/cli-service"); const path = require("path"); module.exports = defineConfig({ + //打包清除console + chainWebpack(config) { + config.optimization.minimizer("terser").tap((args) => { + args[0].terserOptions.compress.drop_console = true; + return args; + }); + }, productionSourceMap: false, // 生产环境是否要生成 sourceMap publicPath: process.env.PUBLIC_PATH ? process.env.PUBLIC_PATH : "./", // 部署应用包时的基本 URL //assetsPublicPath: process.env.NODE_ENV === "production" ? "" : "/",