diff --git a/apps/frontend/next.config.js b/apps/frontend/next.config.js index c9f57d12..b7769d70 100644 --- a/apps/frontend/next.config.js +++ b/apps/frontend/next.config.js @@ -60,7 +60,7 @@ export default withSentryConfig(nextConfig, { org: process.env.SENTRY_ORG, project: process.env.SENTRY_PROJECT, authToken: process.env.SENTRY_AUTH_TOKEN, - + // Sourcemap configuration optimized for monorepo sourcemaps: { disable: false, @@ -68,7 +68,7 @@ export default withSentryConfig(nextConfig, { assets: [ ".next/static/**/*.js", ".next/static/**/*.js.map", - ".next/server/**/*.js", + ".next/server/**/*.js", ".next/server/**/*.js.map", ], ignore: [ @@ -97,7 +97,7 @@ export default withSentryConfig(nextConfig, { telemetry: false, silent: process.env.NODE_ENV === 'production', debug: process.env.NODE_ENV === 'development', - + // Error handling for CI/CD errorHandler: (error) => { console.warn("Sentry build error occurred:", error.message); @@ -105,4 +105,15 @@ export default withSentryConfig(nextConfig, { // Don't fail the build if Sentry upload fails in monorepo context return; }, + + // Document-Policy header for browser profiling + async headers() { + return [{ + source: "/:path*", + headers: [{ + key: "Document-Policy", + value: "js-profiling", + }, ], + }, ]; + }, });