SentinelAI / frontend /next.config.ts
iitian's picture
Serve Next.js SOC dashboard at /ui with FastAPI redirect from /.
81fe24b
raw
history blame contribute delete
851 Bytes
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;