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 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-08 20:46:04 +00:00
co-authored by Claude Opus 4.6
parent edd08fde59
commit a04125afb3
+7
View File
@@ -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'