配置vite项目打包控制台不显示console.log配置
可以看vite官方的配置文档:构建选项 | Vite 官方中文文档
主要是配置:但是terser需要vite3.0以后手动安装一下
build: {sourcemap: false,minify: 'terser',terserOptions: {compress: {drop_console: true,drop_debugger: true,},},},
安装命令:
npm install terser

然后打包就可以了