@@ -103,29 +103,38 @@ const nextConfig = {
103103// Injected content via Sentry wizard below
104104
105105const { withSentryConfig } = require ( "@sentry/nextjs" )
106+ const withSentry = ( config ) =>
107+ withSentryConfig ( config , {
108+ // For all available options, see:
109+ // https://github.com/getsentry/sentry-webpack-plugin#options
106110
107- module . exports = withSentryConfig ( nextConfig , {
108- // For all available options, see:
109- // https://github.com/getsentry/sentry-webpack-plugin#options
111+ org : "mit-office-of-digital-learning" ,
112+ project : "open-next" ,
110113
111- org : "mit-office-of-digital-learning" ,
112- project : "open-next" ,
114+ // Only print logs for uploading source maps in CI
115+ silent : ! process . env . CI ,
113116
114- // Only print logs for uploading source maps in CI
115- silent : ! process . env . CI ,
117+ // For all available options, see:
118+ // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
116119
117- // For all available options, see:
118- // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
120+ // Upload a larger set of source maps for prettier stack traces (increases build time)
121+ widenClientFileUpload : true ,
119122
120- // Upload a larger set of source maps for prettier stack traces (increases build time)
121- widenClientFileUpload : true ,
123+ // Uncomment to route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
124+ // This can increase your server load as well as your hosting bill.
125+ // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
126+ // side errors will fail.
127+ // tunnelRoute: "/monitoring",
122128
123- // Uncomment to route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
124- // This can increase your server load as well as your hosting bill.
125- // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
126- // side errors will fail.
127- // tunnelRoute: "/monitoring",
129+ // Automatically tree-shake Sentry logger statements to reduce bundle size
130+ disableLogger : true ,
131+ } )
128132
129- // Automatically tree-shake Sentry logger statements to reduce bundle size
130- disableLogger : true ,
133+ const withBundleAnalyzer = require ( "@next/ bundle-analyzer" ) ( {
134+ enabled : process . env . ANALYZE === " true" ,
131135} )
136+
137+ module . exports = [ withBundleAnalyzer , withSentry ] . reduce (
138+ ( acc , withPlugin ) => withPlugin ( acc ) ,
139+ nextConfig ,
140+ )
0 commit comments