优化: Safari下载兼容、禁用生产Swagger、前端构建优化移除console、更新COS配置

This commit is contained in:
AIGC Developer
2026-01-05 15:40:28 +08:00
parent 38630dbb66
commit a99cfa28e5
40 changed files with 2550 additions and 1320 deletions

View File

@@ -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
}