import { withSentryConfig } from "@sentry/nextjs"; import type { NextConfig } from "next"; import { withSerwist } from "@serwist/turbopack"; import { LEGACY_GLOBAL_ROUTE_REDIRECTS } from "./src/router/legacy-global-route-redirects"; const nextConfig: NextConfig = { // Docker runs the traced runtime emitted to `.next/standalone`. output: "standalone", async redirects() { return [...LEGACY_GLOBAL_ROUTE_REDIRECTS]; }, images: { remotePatterns: [ { protocol: "https", hostname: "platform-lookaside.fbsbx.com", }, { protocol: "https", hostname: "graph.facebook.com", }, { protocol: "https", hostname: "**.supabase.co", pathname: "/storage/v1/object/**", }, { protocol: "https", hostname: "dbapi.banlv-ai.com", pathname: "/storage/v1/object/**", }, { protocol: "https", hostname: "free.picui.cn", }, ], }, }; const shouldUploadSentrySourcemaps = process.env.CI !== "true" || process.env.SENTRY_UPLOAD_SOURCEMAPS === "1"; export default withSentryConfig(withSerwist(nextConfig), { org: "shenzhen-banlv-zhidao-technolo", project: "javascript-nextjs", silent: !process.env.CI, telemetry: false, widenClientFileUpload: true, // Validation builds keep source maps local; release jobs opt in to upload. sourcemaps: { disable: !shouldUploadSentrySourcemaps, }, webpack: { automaticVercelMonitors: true, treeshake: { removeDebugLogging: true, }, }, });