-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathnext.config.mjs
More file actions
94 lines (91 loc) · 2.29 KB
/
next.config.mjs
File metadata and controls
94 lines (91 loc) · 2.29 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
85
86
87
88
89
90
91
92
93
94
// NOTE: related to src/configs/rewrites.ts
export const DOCUMENTATION_DOMAIN = 'e2b.mintlify.app'
/** @type {import('next').NextConfig} */
const config = {
reactStrictMode: true,
reactCompiler: true,
experimental: {
useCache: true,
turbopackFileSystemCacheForDev: true,
serverActions: {
bodySizeLimit: '5mb',
},
authInterrupts: true,
clientSegmentCache: true,
},
turbopack: {
resolveAlias: {
// Stub Node.js modules for browser builds
// e2b package bundles these packages. when dealing with browser chunks,
// we need to stub these packages for builds.
fs: { browser: './stubs/fs.ts' },
'node:fs': { browser: './stubs/fs.ts' },
'node:fs/promises': { browser: './stubs/fs-promises.ts' },
},
},
logging: {
fetches: {
fullUrl: true,
},
},
serverExternalPackages: ['pino'],
trailingSlash: false,
headers: async () => [
{
source: '/(.*)',
headers: [
{
// config to prevent the browser from rendering the page inside a frame or iframe and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
key: 'X-Frame-Options',
value: 'SAMEORIGIN',
},
],
},
],
rewrites: async () => ({
beforeFiles: [
{
source: '/ph-proxy/static/:path*',
destination: 'https://us-assets.i.posthog.com/static/:path*',
},
{
source: '/ph-proxy/:path*',
destination: 'https://us.i.posthog.com/:path*',
},
// Asset rewrites for Mintlify
{
source: '/mintlify-assets/:path*',
destination: `https://${DOCUMENTATION_DOMAIN}/mintlify-assets/:path*`,
},
{
source: '/_mintlify/:path*',
destination: `https://${DOCUMENTATION_DOMAIN}/_mintlify/:path*`,
},
],
}),
redirects: async () => [
{
source: '/docs/api/cli',
destination: '/auth/cli',
permanent: true,
},
{
source: '/auth/sign-in',
destination: '/sign-in',
permanent: true,
},
{
source: '/auth/sign-up',
destination: '/sign-up',
permanent: true,
},
// SEO Redirects
{
source: '/ai-agents/:path*',
destination: '/',
permanent: true,
},
],
skipTrailingSlashRedirect: true,
}
export default config