Three small build-time fixes surfaced when the Docker images first ran their full production build (previously only dev mode via tsx): - packages/shared: exclude *.test.ts from tsc (vitest types not needed for shipped output), add @types/node dep so node:crypto resolves - packages/db: add @types/node dep for the same reason - apps/web: pin Next.js Turbopack root to the workspace root via next.config.ts so the bundler doesn't fail to detect the monorepo layout from inside the Docker image
23 lines
670 B
TypeScript
23 lines
670 B
TypeScript
import type { NextConfig } from "next";
|
|
import { join } from "node:path";
|
|
|
|
// In a pnpm workspace + Turbopack setup, Next can't always infer the monorepo
|
|
// root (it walks up looking for next/package.json). Pin it explicitly so both
|
|
// dev and production builds resolve files correctly inside the Docker image.
|
|
const workspaceRoot = join(import.meta.dirname, "..", "..");
|
|
|
|
const nextConfig: NextConfig = {
|
|
reactStrictMode: true,
|
|
output: "standalone",
|
|
outputFileTracingRoot: workspaceRoot,
|
|
transpilePackages: ["@cmbot/db", "@cmbot/shared"],
|
|
experimental: {
|
|
typedRoutes: true,
|
|
},
|
|
turbopack: {
|
|
root: workspaceRoot,
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|