fix:打包后去掉调试代码
This commit is contained in:
parent
cab26cdc30
commit
2ce3bcae33
@ -42,6 +42,14 @@ export default defineConfig(({ mode, command }) => {
|
|||||||
build: {
|
build: {
|
||||||
// https://vite.dev/config/build-options.html
|
// https://vite.dev/config/build-options.html
|
||||||
sourcemap: command === 'build' ? false : 'inline',
|
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',
|
outDir: 'dist',
|
||||||
assetsDir: 'assets',
|
assetsDir: 'assets',
|
||||||
chunkSizeWarningLimit: 2000,
|
chunkSizeWarningLimit: 2000,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user