import { withPayload } from "@payloadcms/next/withPayload"; import type { NextConfig } from "next"; import path from "path"; import { fileURLToPath } from "url"; const __filename = fileURLToPath(import.meta.url); const dirname = path.dirname(__filename); const nextConfig: NextConfig = { // NOT "standalone": this project uses a custom server (server.ts) for the // WebRTC signaling WebSocket, and standalone output can't be combined with // a custom server. The Dockerfile runs the full app via `npm start` instead. images: { localPatterns: [ { pathname: "/api/media/file/**", }, ], }, // Two root layouts exist — app/(frontend) and app/(payload) — so a single // not-found.tsx can't compose a 404; see app/global-not-found.tsx. experimental: { globalNotFound: true, }, turbopack: { root: path.resolve(dirname), }, }; export default withPayload(nextConfig, { devBundleServerPackages: false });