Add JS Profiling

This commit is contained in:
Enno Gelhaus 2025-09-18 14:05:38 +02:00 committed by GitHub
parent fb98828358
commit 51a5608f6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 3 deletions

View File

@ -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",
}, ],
}, ];
},
});