-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathapp.config.ts
More file actions
39 lines (32 loc) · 715 Bytes
/
app.config.ts
File metadata and controls
39 lines (32 loc) · 715 Bytes
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
import { defineConfig } from "@tanstack/start/config";
import { App } from "vinxi";
const tanstackApp = defineConfig({
server: {
preset: "cloudflare-pages",
output: {
dir: "{{ rootDir }}/dist",
publicDir: "{{ output.dir }}/public",
serverDir: "{{ output.dir }}/worker",
},
rollupConfig: {
external: ["node:async_hooks"],
},
hooks: {
compiled() {},
},
},
});
const routers = tanstackApp.config.routers.map((r) => {
return {
...r,
middleware: r.target === "server" ? "./app/middleware.tsx" : undefined,
};
});
const app: App = {
...tanstackApp,
config: {
...tanstackApp.config,
routers: routers,
},
};
export default app;