-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
73 lines (65 loc) · 1.66 KB
/
next.config.ts
File metadata and controls
73 lines (65 loc) · 1.66 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
import { fileURLToPath } from 'node:url'
import bundleAnalyzer from '@next/bundle-analyzer'
import { createMDX } from 'fumadocs-mdx/next'
import type { NextConfig } from 'next'
async function createNextConfig(): Promise<NextConfig> {
const { createJiti } = await import('jiti')
const jiti = createJiti(fileURLToPath(import.meta.url))
await jiti.import('./src/env')
const nextConfig: NextConfig = {
reactStrictMode: true,
poweredByHeader: false,
productionBrowserSourceMaps: process.env.SOURCE_MAPS === 'true',
devIndicators: false,
logging: {
fetches: {
fullUrl: true,
},
},
typescript: {
ignoreBuildErrors: true,
},
serverExternalPackages: [
'ts-morph',
'typescript',
'oxc-transform',
'twoslash',
'twoslash-protocol',
'shiki',
'@takumi-rs/image-response',
],
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'avatars.githubusercontent.com',
port: '',
},
{
protocol: 'https',
hostname: 'fumadocs.dev',
port: '',
},
],
},
async rewrites() {
return [
{
source: '/docs/:path*.mdx',
destination: '/llms.mdx/:path*',
},
]
},
}
return nextConfig
}
const bundleAnalyzerPlugin = bundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
})
const mdxPlugin = createMDX()
const NextApp = async () => {
const nextConfig = await createNextConfig()
const plugins = [bundleAnalyzerPlugin, mdxPlugin]
return plugins.reduce((config, plugin) => plugin(config), nextConfig)
}
export default NextApp