Template
1
0
mirror of https://github.com/un-pany/v3-admin-vite.git synced 2025-04-21 11:29:20 +08:00

docs: 优化分块策略和混淆器注释

This commit is contained in:
pany 2023-08-23 13:48:33 +08:00
parent 84885b7bc8
commit 86f11d42b8

View File

@ -52,9 +52,13 @@ export default (configEnv: ConfigEnv): UserConfigExport => {
reportCompressedSize: false,
/** 打包后静态资源目录 */
assetsDir: "static",
/** 分块策略 */
rollupOptions: {
output: {
/**
*
* 1.
* 2. chunk
*/
manualChunks: {
vue: ["vue", "vue-router", "pinia"],
element: ["element-plus", "@element-plus/icons-vue"],
@ -63,12 +67,13 @@ export default (configEnv: ConfigEnv): UserConfigExport => {
}
}
},
/** 混淆器 */
esbuild: {
/** 打包代码时移除 console.log */
/** 打包时移除 console.log */
pure: ["console.log"],
/** 打包代码时移除 debugger */
/** 打包时移除 debugger */
drop: ["debugger"],
/** 打包代码时移除所有注释 */
/** 打包时移除所有注释 */
legalComments: "none"
},
/** Vite 插件 */