-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.config.ts
54 lines (52 loc) · 1.34 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
import { defineConfig } from '@tanstack/start/config';
// import rollupPluginCopy from 'rollup-plugin-copy';
import viteRestart from 'vite-plugin-restart';
import viteTsConfigPaths from 'vite-tsconfig-paths';
const PRESET = 'node-server' as string;
export default defineConfig({
server: {
preset: PRESET,
routeRules: {
'/sitemap.xml': { proxy: { to: '/api/sitemap' } },
},
rollupConfig: {
plugins: [
// Needed to copy TypeScript's shipped .d.ts file for Twoslash to work
// rollupPluginCopy({
// targets: [
// {
// src: 'node_modules/typescript/lib',
// dest:
// PRESET === 'vercel'
// ? '.vercel/output/functions/__nitro.func/node_modules/typescript'
// : '.output/server/node_modules/typescript',
// },
// ],
// hook: 'writeBundle',
// }),
],
},
prerender: {
routes: ['/'],
crawlLinks: true,
},
},
react: {
babel: {
plugins: [['babel-plugin-react-compiler', {}]],
},
},
vite: {
define: {
__BUILD_TIME__: JSON.stringify(new Date().toISOString()),
},
plugins: [
viteTsConfigPaths({
projects: ['./tsconfig.json'],
}),
viteRestart({
reload: ['./dist/**/*'],
}),
],
},
});