import type { NextConfig } from "next"; import { withSentryConfig } from "@sentry/nextjs"; const subDomain = process.env.NEXT_PUBLIC_SUB_DOMAIN || "http://localhost:13000"; const nextConfig: NextConfig = { output: "standalone", experimental: { proxyTimeout: 600000, }, eslint: { ignoreDuringBuilds: true, }, typescript: { ignoreBuildErrors: true, }, logging: { fetches: { fullUrl: true, }, }, async headers() { return [ { source: "/(.*)", headers: [ { key: "Content-Security-Policy", value: "img-src 'self' data: https: blob:;", }, ], }, ]; }, async rewrites() { return { beforeFiles: [ { source: "/_next/static/:path*", destination: `${subDomain}/_next/static/:path*`, has: [ { type: "header", key: "referer", value: "(.*)/cms(.*)", }, ], }, ], afterFiles: [ { source: "/cms/:path*", destination: `${subDomain}/cms/:path*`, }, ], fallback: [], }; }, }; const isSentryEnabled = process.env.NEXT_PUBLIC_SENTRY_ENABLED === "true" && process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT !== "dev" && process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT !== "prd"; export default withSentryConfig(nextConfig, { org: process.env.SENTRY_ORG, project: process.env.SENTRY_PROJECT, silent: true, widenClientFileUpload: true, tunnelRoute: "/monitoring", disable: !isSentryEnabled, webpack: { treeshake: { removeDebugLogging: process.env.NEXT_PUBLIC_SENTRY_DEBUG === "true" ? false : true, }, automaticVercelMonitors: false, }, });