@@ -24,6 +24,7 @@ const nextConfig: NextConfig = {
2424 } ,
2525 experimental : {
2626 optimizeCss : true ,
27+ turbopackSourceMaps : false ,
2728 } ,
2829 ...( env . NODE_ENV === 'development' && {
2930 allowedDevOrigins : [
@@ -41,36 +42,6 @@ const nextConfig: NextConfig = {
4142 ] ,
4243 outputFileTracingRoot : path . join ( __dirname , '../../' ) ,
4344 } ) ,
44- webpack : ( config , { isServer, dev } ) => {
45- // Skip webpack configuration in development when using Turbopack
46- if ( dev && env . NEXT_RUNTIME === 'turbopack' ) {
47- return config
48- }
49-
50- // Configure webpack to use filesystem cache for faster incremental builds
51- if ( config . cache ) {
52- config . cache = {
53- type : 'filesystem' ,
54- buildDependencies : {
55- config : [ __filename ] ,
56- } ,
57- cacheDirectory : path . resolve ( process . cwd ( ) , '.next/cache/webpack' ) ,
58- }
59- }
60-
61- // Avoid aliasing React on the server/edge runtime builds because it bypasses
62- // the "react-server" export condition, which Next.js relies on when
63- // bundling React Server Components and API route handlers.
64- if ( ! isServer ) {
65- config . resolve . alias = {
66- ...config . resolve . alias ,
67- react : path . join ( __dirname , '../../node_modules/react' ) ,
68- 'react-dom' : path . join ( __dirname , '../../node_modules/react-dom' ) ,
69- }
70- }
71-
72- return config
73- } ,
7445 transpilePackages : [ 'prettier' , '@react-email/components' , '@react-email/render' ] ,
7546 async headers ( ) {
7647 return [
@@ -144,6 +115,16 @@ const nextConfig: NextConfig = {
144115 } ,
145116 ] ,
146117 } ,
118+ // Block access to sourcemap files (defense in depth)
119+ {
120+ source : '/(.*)\\.map$' ,
121+ headers : [
122+ {
123+ key : 'x-robots-tag' ,
124+ value : 'noindex' ,
125+ } ,
126+ ] ,
127+ } ,
147128 // Apply security headers to all routes
148129 {
149130 source : '/:path*' ,
0 commit comments