diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9eb74891..4dd88102 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,3 +28,5 @@ jobs: - name: Build for canary run: | bun run build:canary + env: + NODE_OPTIONS: --max-old-space-size=10240 --expose-gc diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index 23b69cf5..a23c5759 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -37,6 +37,7 @@ jobs: run: bun run build:canary env: VITE_PORTAL_GATEWAY_BASE_URL: 'https://m.longbridge.xyz' + NODE_OPTIONS: --max-old-space-size=10240 --expose-gc - name: Upload to Aliyun OSS run: | diff --git a/.gitignore b/.gitignore index e299a36c..71016c25 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ docs/superpowers # generated at build time by fetch-mcp-tools plugin docs/.vitepress/data/mcp-tools.json +docs/.vitepress/.temp/ diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 8919cbc9..f466d247 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -38,6 +38,7 @@ export default defineConfig( metaChunk: true, ignoreDeadLinks: true, base: '/', + buildConcurrency: 10, srcExclude: ['README.md', ...regionSrcExclude], rewrites: rewriteMarkdownPath, @@ -180,7 +181,7 @@ export default defineConfig( vite: { ssr: { - noExternal: ['vue-i18n'], + noExternal: ['vue-i18n', 'mark.js'], }, server: { port: 8000, @@ -203,6 +204,18 @@ export default defineConfig( }, build: { chunkSizeWarningLimit: 1000, + rollupOptions: { + output: { + manualChunks(id) { + if (id.includes('node_modules')) { + if (id.includes('shiki') || id.includes('shikiji')) return 'shiki' + if (id.includes('@vue') || id.includes('vue-demi')) return 'vue-vendor' + if (id.includes('unocss') || id.includes('@unocss')) return 'unocss' + return 'vendor' + } + }, + }, + }, }, resolve: { alias: [ @@ -217,6 +230,15 @@ export default defineConfig( ], }, plugins: [ + { + name: 'gc-between-bundles', + buildEnd() { + if (typeof global.gc === 'function') { + global.gc() + console.log('✓ GC triggered after bundle') + } + }, + }, { name: 'yaml-transform', transform(src: string, id: string) { diff --git a/docs/.vitepress/theme/components/NewHomePage/PlatformStats.vue b/docs/.vitepress/theme/components/NewHomePage/PlatformStats.vue index f7b24a12..db00342f 100644 --- a/docs/.vitepress/theme/components/NewHomePage/PlatformStats.vue +++ b/docs/.vitepress/theme/components/NewHomePage/PlatformStats.vue @@ -1,15 +1,19 @@