import path from "node:path"; import type { NextConfig } from "next"; // THE TWIN BUILD SCRIPTS (package.json). `build` and `build:nodata` run the // exact same command — `next build`. The difference is invisible in the command // and lives entirely in pnpm's lifecycle hook, which matches on the script // NAME: `prebuild` fires before `build` and pulls in `build:data` (the // multi-GB LMDB index + a whole-pool compose), and there is no `prebuild:nodata` // hook, so `build:nodata` renders the site from source alone. // // That is the point of the split: this is the project's own marketing + docs // site, and someone who has only unpacked the source tarball must be able to // build it. Routes that need corpus data degrade honestly (see // app/lib/summary.ts) rather than rendering zeroes. JSON can't hold comments, // hence this note here and in homepage/CHANGELOG.md. const nextConfig: NextConfig = { // Pin the workspace root. Turbopack infers it by walking up for a lockfile // and taking the outermost one, so an unrelated pnpm-lock.yaml anywhere above // the checkout (a stray one in $HOME is enough) silently relocates the root — // after which `@import "../../common/styles/tokens.css"` in app/globals.css // resolves outside the project and `next dev` fails to boot at all. The // export app documents this as load-bearing for exactly this construct, which // this app also uses. turbopack: { root: path.join(__dirname, "..") }, output: "export", trailingSlash: true, images: { unoptimized: true }, staticPageGenerationTimeout: 600, // Increase timeout to 600 seconds transpilePackages: ["yt-dlp-transcript-common"], }; export default nextConfig;