-
Notifications
You must be signed in to change notification settings - Fork 110
Expand file tree
/
Copy pathnext.config.mjs
More file actions
43 lines (36 loc) · 1.06 KB
/
next.config.mjs
File metadata and controls
43 lines (36 loc) · 1.06 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
import { createMDX } from 'fumadocs-mdx/next';
const withMDX = createMDX();
/** @type {import('next').NextConfig} */
const config = {
poweredByHeader: false,
reactStrictMode: true,
serverExternalPackages: ['ts-morph', 'typescript', 'oxc-transform', '@shikijs/twoslash'],
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'novu.co',
},
],
},
// Optimize build performance
experimental: {
// Reduce memory usage during build
workerThreads: false,
// Limit concurrent page generation to prevent overwhelming the build environment
cpus: 1,
},
// Increase static generation timeout for Netlify
staticPageGenerationTimeout: 180,
async rewrites() {
const prefixes = ['platform', 'framework', 'community', 'api-reference', 'guides'];
const extensions = ['md', 'mdx'];
return prefixes.flatMap((prefix) =>
extensions.map((ext) => ({
source: `/${prefix}/:path*.${ext}`,
destination: `/llms.mdx/${prefix}/:path*`,
}))
);
},
};
export default withMDX(config);