ai-code-battle/web/vite.config.ts
jedarden 41c7223f8a refactor(web): promote app.html to index.html as homepage
The main leaderboard SPA is now served at / (index.html) and the
standalone replay viewer lives at /replay.html. This removes the
_redirects workaround in index-builder that patched over the inverted
entry points.

- Rename web/app.html → web/index.html (main SPA)
- Rename web/index.html → web/replay.html (standalone viewer)
- Update vite.config.ts: main→index.html, replay→replay.html
- Remove _redirects injection from deploy.go verifyMergedOutput
- Update pages.json routes and README dev URL

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 08:51:52 -04:00

70 lines
2.3 KiB
TypeScript

import { defineConfig } from 'vite'
import { resolve } from 'path'
export default defineConfig({
root: '.',
build: {
outDir: 'dist',
sourcemap: true,
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
replay: resolve(__dirname, 'replay.html'),
embed: resolve(__dirname, 'embed.html'),
},
output: {
manualChunks(id) {
if (id.includes('node_modules')) return;
// Agentation: React + agentation library (lazy-loaded only on /feedback)
if (id.includes('react') || id.includes('agentation')) {
return 'agentation';
}
// Replay viewer chunk (canvas renderer + win probability)
if (id.includes('replay-viewer') || id.includes('win-probability')) {
return 'replay-viewer';
}
// Replay page (uses replay-viewer, separate from the viewer chunk itself)
if (id.includes('pages/replay')) {
return 'replay-page';
}
// Sandbox chunk (includes engine orchestration + WASM loader)
if (id.includes('pages/sandbox')) {
return 'sandbox';
}
// Evolution page (live polling, SVG lineage tree, island grid)
if (id.includes('pages/evolution')) {
return 'evolution';
}
// Blog pages (markdown parsing)
if (id.includes('pages/blog')) {
return 'blog';
}
// Clip maker (video/GIF export)
if (id.includes('pages/clip-maker')) {
return 'clip-maker';
}
// Series/predictions (chart-heavy)
if (id.includes('pages/series') || id.includes('pages/predictions')) {
return 'charts';
}
// Feedback page (includes its own replay viewer + triggers agentation load)
if (id.includes('pages/feedback')) {
return 'feedback';
}
// Home page (hero, playlists carousel, season bar, evolution mini)
if (id.includes('pages/home')) {
return 'home';
}
// Leaderboard (rating table)
if (id.includes('pages/leaderboard')) {
return 'leaderboard';
}
},
},
},
},
server: {
port: 3000,
},
})