-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
33 lines (32 loc) · 1.06 KB
/
next.config.js
File metadata and controls
33 lines (32 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
const path = require('path')
const withNextra = require('nextra')({
theme: 'nextra-theme-docs',
themeConfig: './theme.config.tsx',
defaultShowCopyCode: true
})
/** @type {import('next').NextConfig} */
module.exports = withNextra({
reactStrictMode: true,
output: 'export',
trailingSlash: true,
images: {
unoptimized: true
},
// Ensure TSX/TS and MDX/MD are recognized in both Pages and App Router
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
// Ensure path aliases like '@/components/*' work in all environments
webpack: (config) => {
config.resolve = config.resolve || {}
config.resolve.alias = {
...(config.resolve.alias || {}),
'@': path.resolve(__dirname),
'@/components': path.resolve(__dirname, 'components'),
'@/lib': path.resolve(__dirname, 'lib'),
'@/content': path.resolve(__dirname, 'content'),
'@/app': path.resolve(__dirname, 'app'),
}
return config
}
// Homepage now served from app/page.tsx (App Router)
// Docs continue to use pages/docs/ (Pages Router with Nextra)
})