-
Notifications
You must be signed in to change notification settings - Fork 118
/
app.config.ts
60 lines (58 loc) · 1.06 KB
/
app.config.ts
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { createApp } from "vinxi"
import tsconfigPaths from "vite-tsconfig-paths"
import UnoCSS from "unocss/vite"
import AutoImport from "unplugin-auto-import/vite"
import react from "@vitejs/plugin-react-swc"
const plugins = [
tsconfigPaths(),
UnoCSS(),
react(),
AutoImport({
include: [
/\.[tj]sx$/,
],
imports: [{
clsx: [
["default", "c"],
],
}],
}),
]
export default createApp({
server: {
preset: "node",
experimental: {
websocket: true,
},
},
routers: [
{
type: "static",
name: "public",
dir: "./public",
},
{
name: "websocket",
type: "http",
handler: "./ws.ts",
target: "server",
base: "/_ws",
plugins: () => plugins,
},
{
type: "http",
name: "trpc",
base: "/trpc",
handler: "./trpcServer.ts",
target: "server",
plugins: () => plugins,
},
{
type: "spa",
name: "client",
handler: "./index.html",
target: "browser",
plugins: () => plugins,
},
],
})