forked from TanStack/router
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.config.js
41 lines (40 loc) · 976 Bytes
/
app.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { createApp } from 'vinxi'
import reactRefresh from '@vitejs/plugin-react'
import { TanStackRouterVite } from '@tanstack/router-plugin/vite'
export default createApp({
server: {
preset: 'vercel', // change to 'node' or 'bun' or anyof the supported presets for nitro (nitro.unjs.io)
experimental: {
asyncContext: true,
},
},
routers: [
{
type: 'static',
name: 'public',
dir: './public',
},
{
type: 'http',
name: 'trpc',
base: '/trpc',
handler: './trpc-server.handler.ts',
target: 'server',
plugins: () => [reactRefresh()],
},
{
type: 'spa',
name: 'client',
handler: './index.html',
target: 'browser',
plugins: () => [
TanStackRouterVite({
routesDirectory: './app/routes',
generatedRouteTree: './app/routeTree.gen.ts',
autoCodeSplitting: true,
}),
reactRefresh(),
],
},
],
})