diff --git a/index.html b/index.html index 0f0ca31..9e33237 100644 --- a/index.html +++ b/index.html @@ -9,11 +9,14 @@ + + <% if (process.env.PUBLIC_MAXKB_URL) { %> + <% } %>
diff --git a/rsbuild.config.ts b/rsbuild.config.ts index e889fa1..d06f5e0 100644 --- a/rsbuild.config.ts +++ b/rsbuild.config.ts @@ -72,7 +72,44 @@ export default defineConfig(({ envMode }) => { performance: { chunkSplit: { strategy: "split-by-module", + override: { + cacheGroups: { + // 将大型编辑器库单独分包 + editor: { + test: /[\\/]node_modules[\\/](codemirror|@codemirror|vue-codemirror|@wangeditor-next|md-editor-v3|y-codemirror\.next)[\\/]/, + name: "vendor-editor", + priority: 30, + }, + // Chart.js 独立分包(包含 canvas-confetti) + charts: { + test: /[\\/]node_modules[\\/](chart\.js|vue-chartjs|@kurkle|canvas-confetti)[\\/]/, + name: "vendor-charts", + priority: 25, + }, + // UI 框架(Naive UI 及其依赖) + ui: { + test: /[\\/]node_modules[\\/](naive-ui|@css-render|css-render|seemly|vooks|vueuc|treemate|vdirs|evtd)[\\/]/, + name: "vendor-ui", + priority: 20, + }, + // Vue 生态 + vue: { + test: /[\\/]node_modules[\\/](vue|vue-router|pinia|@vue|@vueuse)[\\/]/, + name: "vendor-vue", + priority: 15, + }, + // 其他常用库 + common: { + test: /[\\/]node_modules[\\/]/, + name: "vendor-common", + priority: 10, + minChunks: 2, + }, + }, + }, }, + // 移除 console.log(生产环境) + removeConsole: ["log"], }, resolve: { alias: { diff --git a/src/App.vue b/src/App.vue index 4a8009e..bacd66d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,17 +1,41 @@ diff --git a/src/oj/rank/components/Chart.vue b/src/oj/rank/components/Chart.vue index c2fda63..c665f68 100644 --- a/src/oj/rank/components/Chart.vue +++ b/src/oj/rank/components/Chart.vue @@ -1,8 +1,29 @@