File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // Dynamic Import Proxy for Vercel
2+ // This allows Vercel to see a valid Next.js config in the root
3+ // while the actual logic lives in packages/site
4+
5+ import siteConfig from './packages/site/next.config.mjs' ;
6+
7+ // We need to re-export the default export from the site config
8+ // Note: Depending on how site/next.config.mjs exports, this might need adjustment.
9+ // If site config exports a function (like withMDX(config)), it's an object/function.
10+
11+ export default siteConfig ;
Original file line number Diff line number Diff line change 11import { createMDX } from 'fumadocs-mdx/next' ;
2- import fs from 'node:fs' ;
3- import path from 'node:path' ;
42
53const withMDX = createMDX ( ) ;
64
7- function getBuildConfig ( ) {
8- try {
9- const configPath = path . resolve ( process . cwd ( ) , '../../objectdocs.json' ) ;
10- if ( fs . existsSync ( configPath ) ) {
11- const content = fs . readFileSync ( configPath , 'utf-8' ) ;
12- const config = JSON . parse ( content ) ;
13- return config . build || { } ;
14- }
15- } catch ( e ) {
16- console . error ( 'Error loading objectdocs.json in next.config.mjs:' , e ) ;
17- }
18- return { } ;
19- }
20-
21- const buildConfig = getBuildConfig ( ) ;
22- const isStaticExport = buildConfig . output === 'export' ;
23-
245/** @type {import('next').NextConfig } */
256const nextConfig = {
267 reactStrictMode : true ,
27- output : isStaticExport ? 'export' : undefined ,
28- images : {
29- unoptimized : true ,
30- } ,
8+ distDir : '.next' ,
9+ images : { unoptimized : true } ,
3110} ;
3211
3312export default withMDX ( nextConfig ) ;
Original file line number Diff line number Diff line change 11import { defineConfig , defineDocs } from 'fumadocs-mdx/config' ;
22import { siteConfig } from './lib/site-config' ;
3+ import path from 'node:path' ;
4+ import fs from 'node:fs' ;
35
4- const docsDir = process . env . DOCS_DIR || 'content/docs' ;
5- const docsZhDir = process . env . DOCS_ZH_DIR || 'content/docs-zh-CN' ;
6+ function resolveContentDir ( dir : string ) {
7+ if ( process . env . DOCS_DIR && dir === 'content/docs' ) return process . env . DOCS_DIR ;
8+ if ( process . env . DOCS_ZH_DIR && dir === 'content/docs-zh-CN' ) return process . env . DOCS_ZH_DIR ;
9+
10+ // Try local first (Root deployment)
11+ if ( fs . existsSync ( path . resolve ( dir ) ) ) return dir ;
12+
13+ // Try parent (Monorepo/Vercel deployment where CWD is packages/site)
14+ const parentDir = path . join ( '../..' , dir ) ;
15+ if ( fs . existsSync ( path . resolve ( parentDir ) ) ) return parentDir ;
16+
17+ return dir ;
18+ }
19+
20+ const docsDir = resolveContentDir ( 'content/docs' ) ;
21+ const docsZhDir = resolveContentDir ( 'content/docs-zh-CN' ) ;
622
723export const { docs, meta } = defineDocs ( {
824 dir : docsDir ,
Original file line number Diff line number Diff line change 3333 " **/*.ts" ,
3434 " **/*.tsx" ,
3535 " .next/types/**/*.ts" ,
36- " .next/dev/types/**/*.ts"
36+ " .next/dev/types/**/*.ts" ,
37+ " ../../.next/types/**/*.ts" ,
38+ " ../../.next/dev/types/**/*.ts"
3739 ],
3840 "exclude" : [
39- " node_modules"
41+ " node_modules" ,
42+ " ../../.next"
4043 ]
4144}
Original file line number Diff line number Diff line change 11{
2+ "framework" : " nextjs" ,
23 "redirects" : [
34 {
45 "source" : " /" ,
You can’t perform that action at this time.
0 commit comments