litellm/ui/litellm-dashboard/next.config.mjs
Yuneng Jiang 68d52ac251
chore(ui): preserve console.warn in prod builds to match lint allow-list
The lint rule allows console.warn (allow: [warn, error]) but removeConsole
only excluded error, so approved console.warn calls were silently dropped
from production bundles. Add warn to the exclude list so the prod strip
and the lint allow-list agree; only console.log/debug/info are stripped
now, warn and error both survive (verified: warn 85 to 85, error 906 to
906, log 675 to 14).
2026-07-03 14:51:14 -07:00

27 lines
749 B
JavaScript

import path from "path";
import { fileURLToPath } from "url";
/** @type {import('next').NextConfig} */
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const nextConfig = {
output: "export",
compiler: {
removeConsole: process.env.NODE_ENV === "production" ? { exclude: ["error", "warn"] } : false,
},
// Required with output: "export" — default image optimizer runs only in server mode.
// See https://nextjs.org/docs/messages/export-image-api
images: {
unoptimized: true,
},
basePath: "",
assetPrefix: "/litellm-asset-prefix",
trailingSlash: true,
turbopack: {
// Must be absolute; "." is no longer allowed
root: __dirname,
},
};
export default nextConfig;