mirror of https://github.com/halo-dev/halo
chore: create shared common chunks during the ui build (#5580)
#### What type of PR is this? /area ui /kind improvement /milestone 2.14.x #### What this PR does / why we need it: 对 UI 的部分依赖进行分包处理。改动之后,如果下次构建 Halo,而这些依赖没有进行变更,那么 vendor 的 hash 后缀就不会变更,用户在升级之后这些依赖也可以有效命中缓存。 <img width="998" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/60095e08-45f5-4b56-8f79-2999238ebfc5"> #### Does this PR introduce a user-facing change? ```release-note 对 UI 的部分依赖进行分包处理。 ```pull/5590/head
parent
2af92396d4
commit
db0fa1e103
|
@ -79,6 +79,24 @@ export function createViteConfig(options: Options) {
|
|||
outDir: path.resolve(rootDir, outDir),
|
||||
emptyOutDir: true,
|
||||
chunkSizeWarningLimit: 2048,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: {
|
||||
vendor: [
|
||||
"lodash-es",
|
||||
"axios",
|
||||
"vue-grid-layout",
|
||||
"transliteration",
|
||||
"vuedraggable",
|
||||
"emoji-mart",
|
||||
"colorjs.io",
|
||||
"jsencrypt",
|
||||
"overlayscrollbars",
|
||||
"overlayscrollbars-vue",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue