Skip to content

Commit 6661518

Browse files
authored
chore(config): add support for custom distDir in dev mode (#903)
Added logic to conditionally set `distDir` to `.next-dev` for development environments, enhancing separation of dev and prod builds. Updated `.gitignore`, ESLint ignores, and `tsconfig.json` includes accordingly. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Standardized development build output directory to “.next-dev” for docs and UI apps. * Updated ignore rules to exclude “.next-dev” in project and app-level .gitignore files. * Added “.next-dev” to ESLint ignore patterns. * Extended Turbo build outputs to include “.next-dev/**”. * Updated TypeScript configs to include “.next-dev” type outputs and generated content types. * Reordered TypeScript include entries without changing behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 986c7c2 commit 6661518

File tree

8 files changed

+11
-3
lines changed

8 files changed

+11
-3
lines changed

apps/docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# test & build
1010
/coverage
1111
/.next/
12+
/.next-dev/
1213
/.next-prod/
1314
/out/
1415
/build

apps/docs/next.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const withMDX = createMDX();
44

55
/** @type {import("next").NextConfig} */
66
const config = {
7+
distDir: process.env.NODE_ENV === "development" ? ".next-dev" : ".next",
78
reactStrictMode: true,
89
productionBrowserSourceMaps: true,
910
eslint: {

apps/docs/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"**/*.tsx",
2828
".next/types/**/*.ts",
2929
"next-env.d.ts",
30-
"out/types/**/*.ts"
30+
"out/types/**/*.ts",
31+
".next-dev/types/**/*.ts"
3132
],
3233
"exclude": ["node_modules"]
3334
}

apps/ui/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
# next.js
1717
/.next/
18+
/.next-dev/
1819
/out/
1920

2021
# production

apps/ui/next.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { withContentCollections } from "@content-collections/next";
33
import type { NextConfig } from "next";
44

55
const nextConfig: NextConfig = {
6+
distDir: process.env.NODE_ENV === "development" ? ".next-dev" : ".next",
67
productionBrowserSourceMaps: true,
78
eslint: {
89
ignoreDuringBuilds: true,

apps/ui/tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@
2626
}
2727
},
2828
"include": [
29-
"next-env.d.ts",
3029
"**/*.ts",
3130
"**/*.tsx",
31+
"./.content-collections/generated/index.d.ts",
3232
".next/types/**/*.ts",
33-
"./.content-collections/generated/index.d.ts"
33+
"next-env.d.ts",
34+
".next-dev/types/**/*.ts"
3435
],
3536
"exclude": ["node_modules"]
3637
}

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export default [
110110
ignores: [
111111
"**/.tanstack/",
112112
"**/.next/",
113+
"**/.next-dev/",
113114
"**/.source/",
114115
"**/.output/",
115116
"**/.conductor/",

turbo.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"outputs": [
2222
"dist/**",
2323
".next/**",
24+
".next-dev/**",
2425
".vercel/**",
2526
".output/**",
2627
".vinxi/**",

0 commit comments

Comments
 (0)