Skip to content

Commit

Permalink
add: build 分块
Browse files Browse the repository at this point in the history
  • Loading branch information
wangz-code committed Dec 4, 2024
1 parent 29709d7 commit 05ef251
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/celeris/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createViteConfig } from './viteconfig/config/index';

const bigFile = ['SC-Bold.ts', 'SC-Light.ts'];
export default createViteConfig({
overrides: {
server: {
Expand All @@ -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 加载失败
Expand Down

0 comments on commit 05ef251

Please sign in to comment.