-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
54 lines (52 loc) · 1.51 KB
/
next.config.js
File metadata and controls
54 lines (52 loc) · 1.51 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
/** @type {import('next').NextConfig} */
const withMDX = require('@next/mdx')({
extension: /\.mdx?$/,
options: {
remarkPlugins: [],
rehypePlugins: [],
// If you use `MDXProvider`, uncomment the following line.
providerImportSource: "@mdx-js/react",
},
});
const nextConfig = {
// Removed 'output: export' to enable API routes
trailingSlash: true,
// Use default .next directory for better Vercel compatibility
// distDir: 'dist', // Commented out for Vercel deployment
compress: true, // Enable compression for production
images: {
unoptimized: true,
},
// Configure pageExtensions to include md and mdx
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
// Webpack configuration to prevent chunk loading issues
webpack: (config, { dev, isServer }) => {
// Prevent chunk loading errors in development
if (dev && !isServer) {
config.optimization = {
...config.optimization,
splitChunks: {
...config.optimization.splitChunks,
cacheGroups: {
...config.optimization.splitChunks.cacheGroups,
default: false,
vendors: false,
},
},
};
}
return config;
},
// Optionally, add any other Next.js config below
experimental: {
mdxRs: true, // Use the new Rust-based MDX parser
},
turbopack: {
// Configure Turbopack
resolveAlias: {
// Add any module aliases here
},
}
};
// Merge MDX config with Next.js config
module.exports = withMDX(nextConfig);