1
+ import { withSentryConfig } from '@sentry/nextjs' ;
1
2
/** @type {import('next').NextConfig } */
2
3
import withBundleAnalyzer from '@next/bundle-analyzer' ;
3
4
@@ -27,9 +28,7 @@ const nextConfig = {
27
28
'ssl.pstatic.net'
28
29
]
29
30
} ,
30
-
31
31
swcMinify : true ,
32
-
33
32
compiler : {
34
33
styledComponents : true
35
34
} ,
@@ -48,4 +47,42 @@ const nextConfig = {
48
47
}
49
48
} ;
50
49
51
- export default bundleAnalyzer ( nextConfig ) ;
50
+ export default withSentryConfig ( bundleAnalyzer ( nextConfig ) , {
51
+ // For all available options, see:
52
+ // https://github.com/getsentry/sentry-webpack-plugin#options
53
+
54
+ org : 'moaguide' ,
55
+ project : 'javascript-nextjs' ,
56
+
57
+ // Only print logs for uploading source maps in CI
58
+ silent : ! process . env . CI ,
59
+
60
+ // For all available options, see:
61
+ // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
62
+
63
+ // Upload a larger set of source maps for prettier stack traces (increases build time)
64
+ widenClientFileUpload : true ,
65
+
66
+ // Automatically annotate React components to show their full name in breadcrumbs and session replay
67
+ reactComponentAnnotation : {
68
+ enabled : true
69
+ } ,
70
+
71
+ // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
72
+ // This can increase your server load as well as your hosting bill.
73
+ // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
74
+ // side errors will fail.
75
+ tunnelRoute : '/monitoring' ,
76
+
77
+ // Hides source maps from generated client bundles
78
+ hideSourceMaps : true ,
79
+
80
+ // Automatically tree-shake Sentry logger statements to reduce bundle size
81
+ disableLogger : true ,
82
+
83
+ // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
84
+ // See the following for more information:
85
+ // https://docs.sentry.io/product/crons/
86
+ // https://vercel.com/docs/cron-jobs
87
+ automaticVercelMonitors : true
88
+ } ) ;
0 commit comments