2026-03-06 16:27:54 +00:00
|
|
|
import { createRouter, createWebHistory } from 'vue-router'
|
|
|
|
|
|
|
|
|
|
const routes = [
|
|
|
|
|
{
|
|
|
|
|
path: '/',
|
|
|
|
|
name: 'home',
|
|
|
|
|
component: () => import('./pages/HomePage.vue'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/arena',
|
|
|
|
|
name: 'arena',
|
|
|
|
|
component: () => import('./pages/ArenaPage.vue'),
|
|
|
|
|
},
|
2026-03-08 08:38:27 +00:00
|
|
|
{
|
|
|
|
|
path: '/fight-card',
|
|
|
|
|
name: 'fight-card',
|
|
|
|
|
component: () => import('./pages/FightCardPage.vue'),
|
|
|
|
|
},
|
2026-03-06 16:27:54 +00:00
|
|
|
{
|
|
|
|
|
path: '/arena/:fightId',
|
|
|
|
|
name: 'fight',
|
|
|
|
|
component: () => import('./pages/FightPage.vue'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/leaderboard',
|
|
|
|
|
name: 'leaderboard',
|
|
|
|
|
component: () => import('./pages/LeaderboardPage.vue'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/bot/:name',
|
|
|
|
|
name: 'bot-profile',
|
|
|
|
|
component: () => import('./pages/BotProfilePage.vue'),
|
|
|
|
|
},
|
2026-03-07 15:20:14 +00:00
|
|
|
{
|
|
|
|
|
path: '/play/:fightId',
|
|
|
|
|
name: 'human-fight',
|
|
|
|
|
component: () => import('./pages/HumanFightPage.vue'),
|
|
|
|
|
},
|
2026-03-06 16:27:54 +00:00
|
|
|
{
|
|
|
|
|
path: '/register',
|
|
|
|
|
name: 'register',
|
|
|
|
|
component: () => import('./pages/RegisterPage.vue'),
|
|
|
|
|
},
|
2026-03-06 22:13:19 +00:00
|
|
|
{
|
|
|
|
|
path: '/join',
|
|
|
|
|
name: 'join-bout',
|
|
|
|
|
component: () => import('./pages/JoinBoutPage.vue'),
|
|
|
|
|
},
|
2026-03-06 16:27:54 +00:00
|
|
|
{
|
|
|
|
|
path: '/schedule',
|
|
|
|
|
name: 'schedule',
|
|
|
|
|
component: () => import('./pages/SchedulePage.vue'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/sprites',
|
|
|
|
|
name: 'sprites',
|
|
|
|
|
component: () => import('./pages/SpritePreviewPage.vue'),
|
|
|
|
|
},
|
2026-03-08 00:26:12 +00:00
|
|
|
{
|
|
|
|
|
path: '/docs',
|
|
|
|
|
name: 'docs',
|
|
|
|
|
component: () => import('./pages/DocsPage.vue'),
|
|
|
|
|
},
|
2026-03-08 19:46:39 +00:00
|
|
|
{
|
|
|
|
|
path: '/soundboard',
|
|
|
|
|
name: 'soundboard',
|
|
|
|
|
component: () => import('./pages/SoundboardPage.vue'),
|
|
|
|
|
},
|
2026-03-08 19:48:27 +00:00
|
|
|
{
|
|
|
|
|
path: '/feed',
|
|
|
|
|
name: 'feed',
|
|
|
|
|
component: () => import('./pages/FeedPage.vue'),
|
|
|
|
|
},
|
2026-03-08 21:00:48 +00:00
|
|
|
{
|
|
|
|
|
path: '/tournaments',
|
|
|
|
|
name: 'tournaments',
|
|
|
|
|
component: () => import('./pages/TournamentListPage.vue'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/tournament/:id',
|
|
|
|
|
name: 'tournament',
|
|
|
|
|
component: () => import('./pages/TournamentPage.vue'),
|
|
|
|
|
},
|
2026-03-08 21:07:09 +00:00
|
|
|
{
|
|
|
|
|
path: '/practice',
|
|
|
|
|
name: 'practice',
|
|
|
|
|
component: () => import('./pages/PracticePage.vue'),
|
|
|
|
|
},
|
2026-03-09 00:12:36 +00:00
|
|
|
{
|
|
|
|
|
path: '/admin',
|
|
|
|
|
name: 'admin',
|
|
|
|
|
component: () => import('./pages/AdminPage.vue'),
|
|
|
|
|
},
|
2026-03-06 16:27:54 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
export const router = createRouter({
|
|
|
|
|
history: createWebHistory(),
|
|
|
|
|
routes,
|
|
|
|
|
})
|
2026-03-08 11:15:34 +00:00
|
|
|
|
|
|
|
|
// Handle stale chunk 404s after deploy — force reload to get new assets
|
|
|
|
|
router.onError((err, to) => {
|
|
|
|
|
if (err.message.includes('Failed to fetch dynamically imported module') ||
|
|
|
|
|
err.message.includes('Importing a module script failed')) {
|
|
|
|
|
window.location.assign(to.fullPath)
|
|
|
|
|
}
|
|
|
|
|
})
|