优化: Safari下载兼容、禁用生产Swagger、前端构建优化移除console、更新COS配置
This commit is contained in:
@@ -55,6 +55,18 @@ export default defineConfig({
|
||||
outDir: 'dist',
|
||||
assetsDir: 'static',
|
||||
copyPublicDir: true,
|
||||
// 使用 terser 压缩,移除 console
|
||||
minify: 'terser',
|
||||
terserOptions: {
|
||||
compress: {
|
||||
drop_console: true,
|
||||
drop_debugger: true
|
||||
}
|
||||
},
|
||||
// 启用 CSS 代码分割
|
||||
cssCodeSplit: true,
|
||||
// 禁用 source map
|
||||
sourcemap: false,
|
||||
// 代码分割优化
|
||||
rollupOptions: {
|
||||
output: {
|
||||
@@ -83,16 +95,6 @@ export default defineConfig({
|
||||
}
|
||||
}
|
||||
},
|
||||
// 生产环境移除 console
|
||||
// 注意:如果使用 terser,需要安装: npm install -D terser
|
||||
// 暂时使用 esbuild(默认,更快)
|
||||
minify: 'esbuild',
|
||||
// terserOptions: {
|
||||
// compress: {
|
||||
// drop_console: true,
|
||||
// drop_debugger: true
|
||||
// }
|
||||
// },
|
||||
// 块大小警告限制
|
||||
chunkSizeWarningLimit: 1000
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user