@@ -33,6 +33,13 @@ describe('getBuildPluginOptions', () => {
3333 '/path/to/.next/static/chunks/framework.*' ,
3434 '/path/to/.next/static/chunks/polyfills-*' ,
3535 '/path/to/.next/static/chunks/webpack-*' ,
36+ '**/page_client-reference-manifest.js' ,
37+ '**/server-reference-manifest.js' ,
38+ '**/next-font-manifest.js' ,
39+ '**/middleware-build-manifest.js' ,
40+ '**/interception-route-rewrite-manifest.js' ,
41+ '**/route_client-reference-manifest.js' ,
42+ '**/middleware-react-loadable-manifest.js' ,
3643 ] ,
3744 filesToDeleteAfterUpload : undefined ,
3845 rewriteSources : expect . any ( Function ) ,
@@ -121,6 +128,13 @@ describe('getBuildPluginOptions', () => {
121128 '/path/to/.next/static/chunks/framework.*' ,
122129 '/path/to/.next/static/chunks/polyfills-*' ,
123130 '/path/to/.next/static/chunks/webpack-*' ,
131+ '**/page_client-reference-manifest.js' ,
132+ '**/server-reference-manifest.js' ,
133+ '**/next-font-manifest.js' ,
134+ '**/middleware-build-manifest.js' ,
135+ '**/interception-route-rewrite-manifest.js' ,
136+ '**/route_client-reference-manifest.js' ,
137+ '**/middleware-react-loadable-manifest.js' ,
124138 ] ) ;
125139 expect ( result . reactComponentAnnotation ) . toBeDefined ( ) ;
126140 } ) ;
@@ -142,6 +156,13 @@ describe('getBuildPluginOptions', () => {
142156 '/path/to/.next/static/chunks/framework.*' ,
143157 '/path/to/.next/static/chunks/polyfills-*' ,
144158 '/path/to/.next/static/chunks/webpack-*' ,
159+ '**/page_client-reference-manifest.js' ,
160+ '**/server-reference-manifest.js' ,
161+ '**/next-font-manifest.js' ,
162+ '**/middleware-build-manifest.js' ,
163+ '**/interception-route-rewrite-manifest.js' ,
164+ '**/route_client-reference-manifest.js' ,
165+ '**/middleware-react-loadable-manifest.js' ,
145166 ] ) ;
146167 } ) ;
147168
@@ -161,6 +182,13 @@ describe('getBuildPluginOptions', () => {
161182 '/path/to/.next/static/chunks/framework.*' ,
162183 '/path/to/.next/static/chunks/polyfills-*' ,
163184 '/path/to/.next/static/chunks/webpack-*' ,
185+ '**/page_client-reference-manifest.js' ,
186+ '**/server-reference-manifest.js' ,
187+ '**/next-font-manifest.js' ,
188+ '**/middleware-build-manifest.js' ,
189+ '**/interception-route-rewrite-manifest.js' ,
190+ '**/route_client-reference-manifest.js' ,
191+ '**/middleware-react-loadable-manifest.js' ,
164192 ] ) ;
165193 expect ( result . reactComponentAnnotation ) . toBeDefined ( ) ;
166194 } ) ;
@@ -181,6 +209,13 @@ describe('getBuildPluginOptions', () => {
181209 '/path/to/.next/static/chunks/framework.*' ,
182210 '/path/to/.next/static/chunks/polyfills-*' ,
183211 '/path/to/.next/static/chunks/webpack-*' ,
212+ '**/page_client-reference-manifest.js' ,
213+ '**/server-reference-manifest.js' ,
214+ '**/next-font-manifest.js' ,
215+ '**/middleware-build-manifest.js' ,
216+ '**/interception-route-rewrite-manifest.js' ,
217+ '**/route_client-reference-manifest.js' ,
218+ '**/middleware-react-loadable-manifest.js' ,
184219 ] ) ;
185220 expect ( result . reactComponentAnnotation ) . toBeDefined ( ) ;
186221 } ) ;
@@ -205,6 +240,13 @@ describe('getBuildPluginOptions', () => {
205240 '/path/to/.next/static/chunks/framework.*' ,
206241 '/path/to/.next/static/chunks/polyfills-*' ,
207242 '/path/to/.next/static/chunks/webpack-*' ,
243+ '**/page_client-reference-manifest.js' ,
244+ '**/server-reference-manifest.js' ,
245+ '**/next-font-manifest.js' ,
246+ '**/middleware-build-manifest.js' ,
247+ '**/interception-route-rewrite-manifest.js' ,
248+ '**/route_client-reference-manifest.js' ,
249+ '**/middleware-react-loadable-manifest.js' ,
208250 ] ) ;
209251 expect ( result . reactComponentAnnotation ) . toBeUndefined ( ) ;
210252 } ) ;
@@ -228,6 +270,13 @@ describe('getBuildPluginOptions', () => {
228270 '/path/to/.next/static/chunks/framework.*' ,
229271 '/path/to/.next/static/chunks/polyfills-*' ,
230272 '/path/to/.next/static/chunks/webpack-*' ,
273+ '**/page_client-reference-manifest.js' ,
274+ '**/server-reference-manifest.js' ,
275+ '**/next-font-manifest.js' ,
276+ '**/middleware-build-manifest.js' ,
277+ '**/interception-route-rewrite-manifest.js' ,
278+ '**/route_client-reference-manifest.js' ,
279+ '**/middleware-react-loadable-manifest.js' ,
231280 ] ) ;
232281 expect ( result . reactComponentAnnotation ) . toBeUndefined ( ) ;
233282 } ) ;
@@ -444,7 +493,7 @@ describe('getBuildPluginOptions', () => {
444493 expect ( result . sourcemaps ?. assets ) . toEqual ( customAssets ) ;
445494 } ) ;
446495
447- it ( 'uses custom sourcemap ignore patterns when provided ' , ( ) => {
496+ it ( 'merges custom sourcemap ignore patterns with defaults ' , ( ) => {
448497 const customIgnore = [ '**/vendor/**' , '**/node_modules/**' ] ;
449498 const sentryBuildOptions : SentryBuildOptions = {
450499 org : 'test-org' ,
@@ -461,7 +510,58 @@ describe('getBuildPluginOptions', () => {
461510 buildTool : 'webpack-client' ,
462511 } ) ;
463512
464- expect ( result . sourcemaps ?. ignore ) . toEqual ( customIgnore ) ;
513+ // Custom patterns should be appended to defaults, not replace them
514+ expect ( result . sourcemaps ?. ignore ) . toEqual ( [
515+ '/path/to/.next/static/chunks/main-*' ,
516+ '/path/to/.next/static/chunks/framework-*' ,
517+ '/path/to/.next/static/chunks/framework.*' ,
518+ '/path/to/.next/static/chunks/polyfills-*' ,
519+ '/path/to/.next/static/chunks/webpack-*' ,
520+ '**/page_client-reference-manifest.js' ,
521+ '**/server-reference-manifest.js' ,
522+ '**/next-font-manifest.js' ,
523+ '**/middleware-build-manifest.js' ,
524+ '**/interception-route-rewrite-manifest.js' ,
525+ '**/route_client-reference-manifest.js' ,
526+ '**/middleware-react-loadable-manifest.js' ,
527+ '**/vendor/**' ,
528+ '**/node_modules/**' ,
529+ ] ) ;
530+ } ) ;
531+
532+ it ( 'handles single string custom sourcemap ignore pattern' , ( ) => {
533+ const customIgnore = '**/vendor/**' ;
534+ const sentryBuildOptions : SentryBuildOptions = {
535+ org : 'test-org' ,
536+ project : 'test-project' ,
537+ sourcemaps : {
538+ ignore : customIgnore ,
539+ } ,
540+ } ;
541+
542+ const result = getBuildPluginOptions ( {
543+ sentryBuildOptions,
544+ releaseName : mockReleaseName ,
545+ distDirAbsPath : mockDistDirAbsPath ,
546+ buildTool : 'webpack-client' ,
547+ } ) ;
548+
549+ // Single string pattern should be appended to defaults
550+ expect ( result . sourcemaps ?. ignore ) . toEqual ( [
551+ '/path/to/.next/static/chunks/main-*' ,
552+ '/path/to/.next/static/chunks/framework-*' ,
553+ '/path/to/.next/static/chunks/framework.*' ,
554+ '/path/to/.next/static/chunks/polyfills-*' ,
555+ '/path/to/.next/static/chunks/webpack-*' ,
556+ '**/page_client-reference-manifest.js' ,
557+ '**/server-reference-manifest.js' ,
558+ '**/next-font-manifest.js' ,
559+ '**/middleware-build-manifest.js' ,
560+ '**/interception-route-rewrite-manifest.js' ,
561+ '**/route_client-reference-manifest.js' ,
562+ '**/middleware-react-loadable-manifest.js' ,
563+ '**/vendor/**' ,
564+ ] ) ;
465565 } ) ;
466566
467567 it ( 'disables sourcemaps when disable flag is set' , ( ) => {
@@ -769,6 +869,13 @@ describe('getBuildPluginOptions', () => {
769869 '/path/to/.next/static/chunks/framework.*' ,
770870 '/path/to/.next/static/chunks/polyfills-*' ,
771871 '/path/to/.next/static/chunks/webpack-*' ,
872+ '**/page_client-reference-manifest.js' ,
873+ '**/server-reference-manifest.js' ,
874+ '**/next-font-manifest.js' ,
875+ '**/middleware-build-manifest.js' ,
876+ '**/interception-route-rewrite-manifest.js' ,
877+ '**/route_client-reference-manifest.js' ,
878+ '**/middleware-react-loadable-manifest.js' ,
772879 ] ,
773880 filesToDeleteAfterUpload : undefined ,
774881 rewriteSources : expect . any ( Function ) ,
0 commit comments