-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreact-router.config.ts
More file actions
38 lines (35 loc) · 856 Bytes
/
react-router.config.ts
File metadata and controls
38 lines (35 loc) · 856 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
import type { Config } from "@react-router/dev/config";
import { sentryOnBuildEnd } from "@sentry/react-router";
import { vercelPreset } from "@vercel/react-router/vite";
declare module "react-router" {
interface Future {
unstable_middleware: true;
}
}
export default {
ssr: true,
async prerender() {
return [
"/legal/terms-of-service",
"/legal/privacy-policy",
"/sitemap.xml",
"/robots.txt",
];
},
presets: [
...(process.env.VERCEL ? [vercelPreset()] : []),
],
buildEnd: async ({ viteConfig, reactRouterConfig, buildManifest }) => {
if (
process.env.SENTRY_ORG &&
process.env.SENTRY_PROJECT &&
process.env.SENTRY_AUTH_TOKEN
) {
await sentryOnBuildEnd({
viteConfig,
reactRouterConfig,
buildManifest,
});
}
},
} satisfies Config;