@@ -8,6 +8,8 @@ const nextConfig = {
88 } ,
99 reactStrictMode : false ,
1010 transpilePackages : [ 'crypto-hash' ] ,
11+ // Enable production sourcemaps for Sentry
12+ productionBrowserSourceMaps : true ,
1113 images : {
1214 remotePatterns : [
1315 {
@@ -42,9 +44,36 @@ const nextConfig = {
4244 ] ;
4345 } ,
4446} ;
47+
4548export default withSentryConfig ( nextConfig , {
4649 org : process . env . SENTRY_ORG ,
4750 project : process . env . SENTRY_PROJECT ,
4851 authToken : process . env . SENTRY_AUTH_TOKEN ,
52+
53+ // Sourcemap configuration
54+ sourcemaps : {
55+ disable : false , // Enable sourcemap upload (default: false)
56+ assets : [ "**/*.js" , "**/*.js.map" ] , // Files to upload
57+ ignore : [ "**/node_modules/**" ] , // Exclude node_modules
58+ deleteSourcemapsAfterUpload : true , // Delete sourcemaps after upload for security
59+ } ,
60+
61+ // Release configuration (optional but recommended)
62+ release : {
63+ create : true , // Create release in Sentry
64+ finalize : true , // Finalize release after build
65+ } ,
66+
67+ // Additional configuration
4968 telemetry : false ,
69+ silent : process . env . NODE_ENV === 'production' , // Reduce build logs in production
70+ debug : process . env . NODE_ENV === 'development' , // Enable debug in development
71+
72+ // Error handling for CI/CD
73+ errorHandler : ( error ) => {
74+ console . warn ( "Sentry build error occurred:" , error ) ;
75+ // Don't fail the build if Sentry upload fails
76+ // Remove the next line if you want builds to fail on Sentry errors
77+ return ;
78+ } ,
5079} ) ;
0 commit comments