| 1 | import path from "node:path"; |
| 2 | import { fileURLToPath } from "node:url"; |
| 3 | |
| 4 | const __dirname = path.dirname(fileURLToPath(import.meta.url)); |
| 5 | |
| 6 | /** @type {import('next').NextConfig} */ |
| 7 | const nextConfig = { |
| 8 | // Required by the smbCloud `nextjs-ssr` deploy path: produces `.next/standalone`. |
| 9 | output: "standalone", |
| 10 | |
| 11 | // Serve the App Store screenshots as-is. Disabling the optimizer keeps the |
| 12 | // standalone server free of a runtime `sharp` dependency and the /_next/image |
| 13 | // route, which simplifies the multi-tenant smbCloud deploy. |
| 14 | images: { |
| 15 | unoptimized: true, |
| 16 | }, |
| 17 | |
| 18 | // This app lives in a pnpm workspace. Pin the tracing root to the repo root so |
| 19 | // Next.js traces hoisted dependencies deterministically instead of guessing from |
| 20 | // multiple lockfiles. Because the root is above this app, the standalone output |
| 21 | // preserves the source path (`.next/standalone/web/server.js`); the smbCloud CLI |
| 22 | // handles this nested runtime layout. |
| 23 | outputFileTracingRoot: path.join(__dirname, ".."), |
| 24 | |
| 25 | // Ensure the extensionless apple-app-site-association file is served with the |
| 26 | // correct Content-Type — some static hosts default to application/octet-stream |
| 27 | // for files without an extension, which Apple's AASA fetcher may reject. |
| 28 | async headers() { |
| 29 | return [ |
| 30 | { |
| 31 | source: "/.well-known/apple-app-site-association", |
| 32 | headers: [{ key: "Content-Type", value: "application/json" }], |
| 33 | }, |
| 34 | ]; |
| 35 | }, |
| 36 | }; |
| 37 | |
| 38 | export default nextConfig; |