-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy pathnext.config.ts
More file actions
84 lines (79 loc) · 2.2 KB
/
Copy pathnext.config.ts
File metadata and controls
84 lines (79 loc) · 2.2 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import type { NextConfig } from 'next';
import { createMDX } from 'fumadocs-mdx/next';
const withMDX = createMDX();
// @ts-expect-error - No type declarations available for this package
import { PrismaPlugin } from '@prisma/nextjs-monorepo-workaround-plugin';
const CORS_HEADERS = [
{ key: 'Access-Control-Allow-Origin', value: '*' },
{ key: 'Access-Control-Allow-Methods', value: 'GET,POST,PUT,DELETE,OPTIONS' },
{ key: 'Access-Control-Allow-Headers', value: '*' },
];
const nextConfig: NextConfig = {
devIndicators: false,
experimental: {
authInterrupts: true,
globalNotFound: true,
},
typedRoutes: true,
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'avatars.githubusercontent.com',
},
{
protocol: 'https',
hostname: 'erjkmxp9url451wi.public.blob.vercel-storage.com',
},
{
protocol: 'https',
hostname: 'sbaaxpd5ro061s4a.public.blob.vercel-storage.com',
},
{
protocol: 'https',
hostname: '*.googleusercontent.com',
pathname: '**',
},
],
},
transpilePackages: ['x402-next'],
webpack: (config, { isServer }) => {
if (isServer) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
config.plugins = [...config.plugins, new PrismaPlugin()];
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return config;
},
async headers() {
return [
{
source: '/api/oauth/:path*',
headers: CORS_HEADERS,
},
{
source: '/api/v1/:path*',
headers: CORS_HEADERS,
},
{
source: '/api/validate-jwt-token',
headers: CORS_HEADERS,
},
];
},
// This is required to support PostHog trailing slash API requests
skipTrailingSlashRedirect: true,
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*',
},
];
},
};
export default withMDX(nextConfig);