-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.ts
58 lines (56 loc) · 1.93 KB
/
next.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
import type { NextConfig } from "next"
import { withSentryConfig } from "@sentry/nextjs"
const nextConfig: NextConfig = {
experimental: {
reactCompiler: true,
},
images: {
remotePatterns: [
{
protocol: "https",
hostname: "avatars.githubusercontent.com",
pathname: "/**",
},
{
protocol: "https",
hostname: "*.googleusercontent.com",
pathname: "/**",
},
],
},
async rewrites() {
return [
// next15 dropped the .xml extension from the sitemap
{
source: "/sitemap.xml",
destination: "/sitemap",
},
// posthog proxy: https://posthog.com/docs/advanced/proxy/nextjs
{
source: "/ingest/static/:path*",
destination: "https://us-assets.i.posthog.com/static/:path*",
},
{
source: "/ingest/:path*",
destination: "https://us.i.posthog.com/:path*",
},
{
source: "/ingest/decide",
destination: "https://us.i.posthog.com/decide",
},
]
},
// This is required to support PostHog trailing slash API requests
skipTrailingSlashRedirect: true,
}
// export with sentry config, if you don't have a sentry auth token it will just ignore it
export default withSentryConfig(nextConfig, {
silent: true, // Used to suppress logs, set to false to see sentry logs on build
telemetry: false, // Set to true to send telemetry data to sentry
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#configure-tunneling-to-avoid-ad-blockers
tunnelRoute: "/monitoring-tunnel",
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#use-hidden-source-map
hideSourceMaps: process.env.NEXT_PUBLIC_VERCEL_ENV === "production",
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#disable-the-sentry-sdk-debug-logger-to-save-bundle-size
disableLogger: process.env.NEXT_PUBLIC_VERCEL_ENV === "production",
})