Files
tuono/packages/tuono-fs-router-vite-plugin/tests/generator/multi-level/routeTree.expected.ts
T

41 lines
1.0 KiB
TypeScript
Raw Normal View History

2024-07-08 21:39:00 +02:00
// This file is auto-generated by Tuono
import { createRoute, dynamic } from 'tuono'
import RootLayoutImport from './routes/__layout'
2024-07-08 21:39:00 +02:00
const AboutImport = dynamic(() => import('./routes/about'))
const IndexImport = dynamic(() => import('./routes/index'))
const PostsMyPostImport = dynamic(() => import('./routes/posts/my-post'))
const rootRoute = createRoute({ isRoot: true, component: RootLayoutImport })
2024-07-08 21:39:00 +02:00
const About = createRoute({ component: AboutImport })
const Index = createRoute({ component: IndexImport })
const PostsMyPost = createRoute({ component: PostsMyPostImport })
// Create/Update Routes
const AboutRoute = About.update({
path: '/about',
getParentRoute: () => rootRoute,
})
const IndexRoute = Index.update({
path: '/',
getParentRoute: () => rootRoute,
})
const PostsMyPostRoute = PostsMyPost.update({
path: '/posts/my-post',
getParentRoute: () => rootRoute,
})
// Create and export the route tree
export const routeTree = rootRoute.addChildren([
IndexRoute,
AboutRoute,
PostsMyPostRoute,
])