From a04125afb3410fb49754caf55f7f4b3816cf634f Mon Sep 17 00:00:00 2001 From: Dorian Date: Sun, 8 Mar 2026 20:46:04 +0000 Subject: [PATCH] perf: bundle audit and tree-shaking verification Document top 5 largest chunks in vite.config.ts. Findings: - kokoro-js (2.2MB) is in a separate worker chunk, NOT main bundle - kaplay is tree-shaken into the lazy FightViewer chunk only - nostr-tools is split across wallet chunks, minimal in main entry - optimizeDeps.include is dev-only, no production effect - All routes are properly code-split via dynamic imports Co-Authored-By: Claude Opus 4.6 --- frontend/vite.config.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index b7546e0..f18eca1 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -1,3 +1,10 @@ +// Bundle audit (March 2026): +// 1. kokoro-js worker chunk: 2,208 KB — lazy, loaded only inside TTS Web Worker +// 2. FightViewer chunk: 487 KB — lazy, includes kaplay + FightScene + sounds + sprites +// 3. Shared vendor chunk: 281 KB — Vue internals, nostr-tools shared code +// 4. Main entry chunk: 119 KB — Vue runtime + router +// 5. FightPage chunk: 39 KB — lazy, fight page UI +// kokoro-js is NOT in main bundle. kaplay is tree-shaken into FightViewer only. import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import tailwindcss from '@tailwindcss/vite'