vite.congig.js drop console info #8229
Answered
by
sapphi-red
jiangkaifree
asked this question in
Q&A
-
Describe the bugI want drop console info , this is import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
build: {
minify: "terser", // ok
minify: "esbuild", // no
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true,
},
},
},
});so, if use Reproductionhttps://stackblitz.com/edit/vitejs-vite-qruayx?file=vite.config.js,main.js&terminal=dev System InfoSystem:
OS: Windows 10 10.0.19043
CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Memory: 2.31 GB / 15.90 GB
Binaries:
Node: 16.14.2 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.18 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.5.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.19041.1266.0), Chromium (101.0.1210.47)
Internet Explorer: 11.0.19041.1566
npmPackages:
@vitejs/plugin-vue: ^2.3.3 => 2.3.3
vite: ^2.9.9 => 2.9.9Used Package Managerpnpm LogsNo response Validations
|
Beta Was this translation helpful? Give feedback.
Answered by
sapphi-red
May 19, 2022
Replies: 2 comments 5 replies
-
|
Converting to discussion as this is a question. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
There is an option in esbuild. |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
sapphi-red
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

There is an option in esbuild.
https://esbuild.github.io/api/#drop