@@ -89,6 +89,7 @@ const baseBuildContext = {
8989 buildId : 'sItStAyLiEdOwN' ,
9090 dir : '/Users/Maisey/projects/squirrelChasingSimulator' ,
9191 config : { target : 'server' as const } ,
92+ webpack : { version : '5.4.15' } ,
9293} ;
9394const serverBuildContext = { isServer : true , ...baseBuildContext } ;
9495const clientBuildContext = { isServer : false , ...baseBuildContext } ;
@@ -389,7 +390,21 @@ describe('Sentry webpack plugin config', () => {
389390 ] ) ;
390391 } ) ;
391392
392- it ( 'has the correct value when building serverful server bundles' , async ( ) => {
393+ it ( 'has the correct value when building serverful server bundles using webpack 4' , async ( ) => {
394+ const finalWebpackConfig = await materializeFinalWebpackConfig ( {
395+ userNextConfig,
396+ incomingWebpackConfig : serverWebpackConfig ,
397+ incomingWebpackBuildContext : { ...serverBuildContext , webpack : { version : '4' } } ,
398+ } ) ;
399+
400+ const sentryWebpackPlugin = finalWebpackConfig . plugins ?. [ 0 ] as SentryWebpackPluginType ;
401+
402+ expect ( sentryWebpackPlugin . options ?. include ) . toEqual ( [
403+ { paths : [ '.next/server/pages/' ] , urlPrefix : '~/_next/server/pages' } ,
404+ ] ) ;
405+ } ) ;
406+
407+ it ( 'has the correct value when building serverful server bundles using webpack 5' , async ( ) => {
393408 const finalWebpackConfig = await materializeFinalWebpackConfig ( {
394409 userNextConfig,
395410 incomingWebpackConfig : serverWebpackConfig ,
@@ -399,8 +414,8 @@ describe('Sentry webpack plugin config', () => {
399414 const sentryWebpackPlugin = finalWebpackConfig . plugins ?. [ 0 ] as SentryWebpackPluginType ;
400415
401416 expect ( sentryWebpackPlugin . options ?. include ) . toEqual ( [
402- { paths : [ '.next/server/chunks/' ] , urlPrefix : '~/_next/server/chunks' } ,
403417 { paths : [ '.next/server/pages/' ] , urlPrefix : '~/_next/server/pages' } ,
418+ { paths : [ '.next/server/chunks/' ] , urlPrefix : '~/_next/server/chunks' } ,
404419 ] ) ;
405420 } ) ;
406421 } ) ;
0 commit comments