import type { NextConfig } from "next"; import { join } from "node:path"; // Pin Turbopack's workspace root explicitly — pnpm + Turbopack can't always // infer it inside Docker bind mounts. const workspaceRoot = join(import.meta.dirname, "..", ".."); // We consume @cmbot/db and @cmbot/shared via their compiled dist (their // package.json `main` points at ./dist/index.js). The dist is built at // container start (see docker-compose.dev.yml) and during the production // Docker build (see docker/web.Dockerfile). This sidesteps Turbopack's // inability to resolve NodeNext-style `.js` extensions to `.ts` source. const nextConfig: NextConfig = { reactStrictMode: true, output: "standalone", outputFileTracingRoot: workspaceRoot, experimental: { typedRoutes: true, }, turbopack: { root: workspaceRoot, }, }; export default nextConfig;