@@ -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 {
@@ -151,74 +136,69 @@ const moduleExports = {
151136 ...determineIpfsGateways ( ) ,
152137 ] ,
153138 } ,
139+ experimental : { } ,
154140 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 ,
165141} ;
166142
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- ) ;
143+ if ( process . env . NODE_ENV !== "production" ) {
144+ // do not add any extra plugins outside of production
145+ module . exports = moduleExports ;
146+ } else {
147+ // add plugins for production
148+ // attempt to solve OOM issues?
149+ moduleExports . experimental . webpackMemoryOptimizations = true ;
150+
151+ const { withSentryConfig } = require ( "@sentry/nextjs" ) ;
152+ const { withPlausibleProxy } = require ( "next-plausible" ) ;
153+ const withBundleAnalyzer = require ( "@next/bundle-analyzer" ) ( {
154+ enabled : process . env . ANALYZE === "true" ,
155+ } ) ;
156+
157+ module . exports = withBundleAnalyzer (
158+ withPlausibleProxy ( {
159+ customDomain : "https://pl.thirdweb.com" ,
160+ scriptName : "pl" ,
161+ } ) (
162+ withSentryConfig ( moduleExports , {
163+ // For all available options, see:
164+ // https://github.com/getsentry/sentry-webpack-plugin#options
165+
166+ org : "thirdweb-dev" ,
167+ project : "dashboard" ,
168+ // An auth token is required for uploading source maps.
169+ authToken : process . env . SENTRY_AUTH_TOKEN ,
170+ // Suppresses source map uploading logs during build
171+ silent : true ,
172+ // For all available options, see:
173+ // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
174+
175+ // Upload a larger set of source maps for prettier stack traces (increases build time)
176+ widenClientFileUpload : true ,
177+
178+ // Transpiles SDK to be compatible with IE11 (increases bundle size)
179+ transpileClientSDK : false ,
180+
181+ // Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
182+ tunnelRoute : "/err" ,
183+
184+ // Hides source maps from generated client bundles
185+ hideSourceMaps : true ,
186+
187+ // Automatically tree-shake Sentry logger statements to reduce bundle size
188+ disableLogger : true ,
189+
190+ // Enables automatic instrumentation of Vercel Cron Monitors.
191+ // See the following for more information:
192+ // https://docs.sentry.io/product/crons/
193+ // https://vercel.com/docs/cron-jobs
194+ automaticVercelMonitors : false ,
195+
196+ /**
197+ * Disables the Sentry Webpack plugin on the server.
198+ * See: https://github.com/getsentry/sentry-javascript/issues/10468#issuecomment-2004710692
199+ */
200+ disableServerWebpackPlugin : true ,
201+ } ) ,
202+ ) ,
203+ ) ;
204+ }
0 commit comments