@@ -86,21 +86,6 @@ function determineIpfsGateways() {
8686
8787/** @type {import('next').NextConfig } */
8888const moduleExports = {
89- webpack : ( config , { dev } ) => {
90- if ( config . cache && ! dev ) {
91- config . cache = Object . freeze ( {
92- type : "memory" ,
93- } ) ;
94- config . cache . maxMemoryGenerations = 0 ;
95- }
96- config . externals . push ( "pino-pretty" ) ;
97- config . module = {
98- ...config . module ,
99- exprContextCritical : false ,
100- } ;
101- // Important: return the modified config
102- return config ;
103- } ,
10489 async headers ( ) {
10590 return [
10691 {
@@ -152,73 +137,65 @@ const moduleExports = {
152137 ] ,
153138 } ,
154139 reactStrictMode : true ,
155- experimental : {
156- scrollRestoration : true ,
157- webpackBuildWorker : true ,
158- serverSourceMaps : false ,
159- } ,
160- cacheMaxMemorySize : 0 ,
161- compiler : {
162- emotion : true ,
163- } ,
164- productionBrowserSourceMaps : false ,
165140} ;
166141
167- const { withSentryConfig } = require ( "@sentry/nextjs" ) ;
168- const { withPlausibleProxy } = require ( "next-plausible" ) ;
169-
170- // we only want sentry on production environments
171- const wSentry =
172- process . env . NODE_ENV === "production" ? withSentryConfig : ( x ) => x ;
173-
174- const withBundleAnalyzer = require ( "@next/bundle-analyzer" ) ( {
175- enabled : process . env . ANALYZE === "true" ,
176- } ) ;
177-
178- module . exports = withBundleAnalyzer (
179- withPlausibleProxy ( {
180- customDomain : "https://pl.thirdweb.com" ,
181- scriptName : "pl" ,
182- } ) (
183- wSentry ( moduleExports , {
184- // For all available options, see:
185- // https://github.com/getsentry/sentry-webpack-plugin#options
186-
187- org : "thirdweb-dev" ,
188- project : "dashboard" ,
189- // An auth token is required for uploading source maps.
190- authToken : process . env . SENTRY_AUTH_TOKEN ,
191- // Suppresses source map uploading logs during build
192- silent : true ,
193- // For all available options, see:
194- // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
195-
196- // Upload a larger set of source maps for prettier stack traces (increases build time)
197- widenClientFileUpload : true ,
198-
199- // Transpiles SDK to be compatible with IE11 (increases bundle size)
200- transpileClientSDK : false ,
201-
202- // Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
203- tunnelRoute : "/err" ,
204-
205- // Hides source maps from generated client bundles
206- hideSourceMaps : true ,
207-
208- // Automatically tree-shake Sentry logger statements to reduce bundle size
209- disableLogger : true ,
210-
211- // Enables automatic instrumentation of Vercel Cron Monitors.
212- // See the following for more information:
213- // https://docs.sentry.io/product/crons/
214- // https://vercel.com/docs/cron-jobs
215- automaticVercelMonitors : false ,
216-
217- /**
218- * Disables the Sentry Webpack plugin on the server.
219- * See: https://github.com/getsentry/sentry-javascript/issues/10468#issuecomment-2004710692
220- */
221- disableServerWebpackPlugin : true ,
222- } ) ,
223- ) ,
224- ) ;
142+ if ( process . env . NODE_ENV !== "production" ) {
143+ // do not add any extra plugins outside of production
144+ module . exports = moduleExports ;
145+ } else {
146+ // add plugins for production
147+
148+ const { withSentryConfig } = require ( "@sentry/nextjs" ) ;
149+ const { withPlausibleProxy } = require ( "next-plausible" ) ;
150+ const withBundleAnalyzer = require ( "@next/bundle-analyzer" ) ( {
151+ enabled : process . env . ANALYZE === "true" ,
152+ } ) ;
153+
154+ module . exports = withBundleAnalyzer (
155+ withPlausibleProxy ( {
156+ customDomain : "https://pl.thirdweb.com" ,
157+ scriptName : "pl" ,
158+ } ) (
159+ withSentryConfig ( moduleExports , {
160+ // For all available options, see:
161+ // https://github.com/getsentry/sentry-webpack-plugin#options
162+
163+ org : "thirdweb-dev" ,
164+ project : "dashboard" ,
165+ // An auth token is required for uploading source maps.
166+ authToken : process . env . SENTRY_AUTH_TOKEN ,
167+ // Suppresses source map uploading logs during build
168+ silent : true ,
169+ // For all available options, see:
170+ // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
171+
172+ // Upload a larger set of source maps for prettier stack traces (increases build time)
173+ widenClientFileUpload : true ,
174+
175+ // Transpiles SDK to be compatible with IE11 (increases bundle size)
176+ transpileClientSDK : false ,
177+
178+ // Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
179+ tunnelRoute : "/err" ,
180+
181+ // Hides source maps from generated client bundles
182+ hideSourceMaps : true ,
183+
184+ // Automatically tree-shake Sentry logger statements to reduce bundle size
185+ disableLogger : true ,
186+
187+ // Enables automatic instrumentation of Vercel Cron Monitors.
188+ // See the following for more information:
189+ // https://docs.sentry.io/product/crons/
190+ // https://vercel.com/docs/cron-jobs
191+ automaticVercelMonitors : false ,
192+
193+ /**
194+ * Disables the Sentry Webpack plugin on the server.
195+ * See: https://github.com/getsentry/sentry-javascript/issues/10468#issuecomment-2004710692
196+ */
197+ disableServerWebpackPlugin : true ,
198+ } ) ,
199+ ) ,
200+ ) ;
201+ }
0 commit comments