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 加载失败