forked from Justin322322/BetterGov-Docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
66 lines (55 loc) · 1.68 KB
/
next.config.mjs
File metadata and controls
66 lines (55 loc) · 1.68 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
import { createMDX } from 'fumadocs-mdx/next';
const withMDX = createMDX({
// MDX configuration options
configPath: './source.config.ts',
rootContentPath: './content',
// Enable syntax highlighting and other MDX features
mdxOptions: {
remarkPlugins: [],
rehypePlugins: [],
development: process.env.NODE_ENV === 'development',
},
});
/** @type {import('next').NextConfig} */
const config = {
reactStrictMode: true,
// Enable experimental features for better performance
experimental: {
mdxRs: false, // Keep using the JS-based MDX compiler for compatibility
optimizePackageImports: ['fumadocs-ui', 'fumadocs-core'],
},
// Configure content source directories
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'md', 'mdx'],
// Image optimization for documentation assets
images: {
remotePatterns: [
{
protocol: 'https',
hostname: '**',
},
],
formats: ['image/webp', 'image/avif'],
},
// Note: redirects and headers are not supported with static export
// For static hosting, configure these at the hosting provider level
// Output configuration for deployment
// Comment out export to enable API routes for search
// output: 'export',
trailingSlash: false,
// Asset prefix for CDN deployment (can be configured later)
assetPrefix: process.env.ASSET_PREFIX || '',
// Webpack configuration for better bundle optimization
webpack: (config, { isServer }) => {
// Optimize bundle size
if (!isServer) {
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
path: false,
os: false,
};
}
return config;
},
};
export default withMDX(config);