File size: 851 Bytes
8b3905d
 
 
81fe24b
 
 
 
8b3905d
 
 
 
 
 
 
81fe24b
 
 
 
 
 
 
8b3905d
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import type { NextConfig } from "next";
import path from "path";

/** When `NEXT_STATIC_EXPORT=1`, emit `out/` for embedding behind FastAPI (e.g. Hugging Face Docker Space). */
const staticExport = process.env.NEXT_STATIC_EXPORT === "1";
const basePath = process.env.NEXT_PUBLIC_BASE_PATH?.trim() ?? "";

const nextConfig: NextConfig = {
  // Keeps output file tracing anchored to this app when multiple lockfiles exist on the machine.
  outputFileTracingRoot: path.join(process.cwd()),
  // ESLint 9 + eslint-config-next can throw "Components.detect is not a function" for react plugin; run `npm run lint` locally.
  eslint: {
    ignoreDuringBuilds: true,
  },
  ...(staticExport
    ? {
        output: "export" as const,
        images: { unoptimized: true },
      }
    : {}),
  ...(basePath ? { basePath } : {}),
};

export default nextConfig;