fix:打包后去掉调试代码
This commit is contained in:
parent
cab26cdc30
commit
2ce3bcae33
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user