Skip to content

Commit c707b1f

Browse files
committed
Update build process and Next.js config
Removes post-build output copying/linking logic from the CLI build command. Updates Next.js config to set distDir using an absolute path. Expands tsconfig includes for .next types. Removes 'framework' field from vercel.json.
1 parent 1f17600 commit c707b1f

4 files changed

Lines changed: 5 additions & 37 deletions

File tree

packages/cli/src/commands/build.mjs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -42,39 +42,5 @@ export function registerBuildCommand(cli) {
4242
cwd: nextAppDir // CRITICAL: Run in the Next.js app directory
4343
});
4444

45-
child.on('close', (code) => {
46-
if (code === 0) {
47-
// Copy output to project root
48-
const src = path.join(nextAppDir, 'out');
49-
const dest = path.join(process.cwd(), 'out');
50-
51-
if (fs.existsSync(src)) {
52-
console.log(`\nMoving build output to ${dest}...`);
53-
if (fs.existsSync(dest)) {
54-
fs.rmSync(dest, { recursive: true, force: true });
55-
}
56-
fs.cpSync(src, dest, { recursive: true });
57-
console.log(`Build successfully output to: ${dest}`);
58-
} else {
59-
// Check for .next directory (dynamic build)
60-
const srcNext = path.join(nextAppDir, '.next');
61-
const destNext = path.join(process.cwd(), '.next');
62-
63-
if (fs.existsSync(srcNext) && srcNext !== destNext) {
64-
console.log(`\nLinking .next build output to ${destNext}...`);
65-
if (fs.existsSync(destNext)) {
66-
fs.rmSync(destNext, { recursive: true, force: true });
67-
}
68-
// Use symlink instead of copy to preserve internal symlinks in .next (pnpm support)
69-
fs.symlinkSync(srcNext, destNext, 'dir');
70-
console.log(`Build successfully linked to: ${destNext}`);
71-
} else {
72-
console.log(`\nNo 'out' directory generated in ${src}.`);
73-
console.log(`This is expected if 'output: export' is disabled.`);
74-
}
75-
}
76-
}
77-
process.exit(code);
78-
});
7945
});
8046
}

packages/site/next.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { createMDX } from 'fumadocs-mdx/next';
2+
import path from 'path';
23

34
const withMDX = createMDX();
45

56
/** @type {import('next').NextConfig} */
67
const nextConfig = {
78
reactStrictMode: true,
8-
distDir: '.next',
9+
distDir: path.join(process.cwd(), '.next'),
910
images: { unoptimized: true },
1011
};
1112

packages/site/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333
"**/*.ts",
3434
"**/*.tsx",
3535
".next/types/**/*.ts",
36-
".next/dev/types/**/*.ts"
36+
".next/dev/types/**/*.ts",
37+
"/Users/steedos/Documents/GitHub/docs/packages/site/.next/types/**/*.ts",
38+
"/Users/steedos/Documents/GitHub/docs/packages/site/.next/dev/types/**/*.ts"
3739
],
3840
"exclude": [
3941
"node_modules"

vercel.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"framework": "nextjs",
32
"redirects": [
43
{
54
"source": "/",

0 commit comments

Comments
 (0)