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