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).
This commit is contained in:
Yuneng Jiang 2026-07-03 14:51:14 -07:00
parent 5b7c73a573
commit 68d52ac251
No known key found for this signature in database

View file

@ -8,7 +8,7 @@ const __dirname = path.dirname(__filename);
const nextConfig = {
output: "export",
compiler: {
removeConsole: process.env.NODE_ENV === "production" ? { exclude: ["error"] } : false,
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