From 05ef25100c449de5e1f5aa33e1e8fea714698926 Mon Sep 17 00:00:00 2001 From: wangqz <2809755637@qq.com> Date: Wed, 4 Dec 2024 18:12:17 +0800 Subject: [PATCH] =?UTF-8?q?add:=20build=20=E5=88=86=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/celeris/vite.config.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/celeris/vite.config.ts b/apps/celeris/vite.config.ts index 1c2ba58..c452d3b 100644 --- a/apps/celeris/vite.config.ts +++ b/apps/celeris/vite.config.ts @@ -1,5 +1,5 @@ import { createViteConfig } from './viteconfig/config/index'; - +const bigFile = ['SC-Bold.ts', 'SC-Light.ts']; export default createViteConfig({ overrides: { server: { @@ -15,6 +15,10 @@ export default createViteConfig({ build: { rollupOptions: { output: { + manualChunks(id) { + if (id.includes(bigFile[0])) return 'large-chunk-SC-Bold'; + if (id.includes(bigFile[1])) return 'large-chunk-SC-Light'; + }, //https://github.com/rollup/rollup/blob/master/src/utils/sanitizeFileName.ts sanitizeFileName(name) { // eslint-disable-next-line no-control-regex 无效字符会导致gitpages 加载失败