-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
31 lines (27 loc) · 911 Bytes
/
next.config.ts
File metadata and controls
31 lines (27 loc) · 911 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
import type { NextConfig } from 'next'
import { fileURLToPath } from 'node:url'
import createJiti from 'jiti'
// Validate env vars at build time
const jiti = createJiti(fileURLToPath(import.meta.url))
jiti('./src/env')
const nextConfig: NextConfig = {
// Transpile Base UI packages for better Turbopack + pnpm compatibility
transpilePackages: ['@base-ui/react', '@base-ui/utils'],
// PostHog reverse proxy configuration
// This routes analytics requests through your domain to avoid ad blockers
async rewrites() {
return [
{
source: '/ingest/static/:path*',
destination: 'https://us-assets.i.posthog.com/static/:path*',
},
{
source: '/ingest/:path*',
destination: 'https://us.i.posthog.com/:path*',
},
]
},
// Required to support PostHog trailing slash API requests
skipTrailingSlashRedirect: true,
}
export default nextConfig