cm_whatsapp_bot_v1/apps/web/next.config.ts
yiekheng 7708dd671c feat(web): dashboard + accounts list + account detail
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 23:27:24 +08:00

29 lines
999 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,
resolveExtensions: [".tsx", ".ts", ".jsx", ".js", ".mjs", ".json"],
resolveAlias: {
// Turbopack doesn't strip the `.js` extension alias that NodeNext requires.
// Map the compiled-style paths back to the real TS source files.
"@cmbot/db/schema.js": `${workspaceRoot}/packages/db/src/schema.ts`,
},
},
};
export default nextConfig;