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, // Allow Server Actions and dev HMR from the LAN host (phone testing). // Tighten before exposing publicly via the reverse proxy. allowedDevOrigins: ["192.168.0.253", "test.04080616.xyz", "rexwa.04080616.xyz"], experimental: { typedRoutes: true, }, turbopack: { root: workspaceRoot, }, }; export default nextConfig;