From 2ce3bcae33cdabdab500bcb5704735e06b4624aa Mon Sep 17 00:00:00 2001 From: lz-ui Date: Sun, 28 Sep 2025 16:16:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=89=93=E5=8C=85=E5=90=8E=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E8=B0=83=E8=AF=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vite.config.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vite.config.js b/vite.config.js index 030dbdf..ccb9237 100644 --- a/vite.config.js +++ b/vite.config.js @@ -42,6 +42,14 @@ export default defineConfig(({ mode, command }) => { build: { // https://vite.dev/config/build-options.html sourcemap: command === 'build' ? false : 'inline', + minify: 'terser', // 启用 terser 压缩 + terserOptions: { + compress: { + pure_funcs: ['console.log'], // 只删除 console.log + //drop_console: true, // 删除所有 console + drop_debugger: true, // 删除 debugger + } + }, outDir: 'dist', assetsDir: 'assets', chunkSizeWarningLimit: 2000,