@@ -81,7 +81,7 @@ export function constructWebpackConfigFunction(
8181 const newConfig = setUpModuleRules ( rawNewConfig ) ;
8282
8383 // Add a loader which will inject code that sets global values
84- addValueInjectionLoader ( newConfig , userNextConfig , userSentryOptions , buildContext ) ;
84+ addValueInjectionLoader ( newConfig , userNextConfig , userSentryOptions , buildContext , userSentryWebpackPluginOptions ) ;
8585
8686 newConfig . module . rules . push ( {
8787 test : / n o d e _ m o d u l e s [ / \\ ] @ s e n t r y [ / \\ ] n e x t j s / ,
@@ -939,6 +939,7 @@ function addValueInjectionLoader(
939939 userNextConfig : NextConfigObject ,
940940 userSentryOptions : UserSentryOptions ,
941941 buildContext : BuildContext ,
942+ sentryWebpackPluginOptions : Partial < SentryWebpackPluginOptions > ,
942943) : void {
943944 const assetPrefix = userNextConfig . assetPrefix || userNextConfig . basePath || '' ;
944945
@@ -951,7 +952,9 @@ function addValueInjectionLoader(
951952
952953 // The webpack plugin's release injection breaks the `app` directory so we inject the release manually here instead.
953954 // Having a release defined in dev-mode spams releases in Sentry so we only set one in non-dev mode
954- SENTRY_RELEASE : buildContext . dev ? undefined : { id : getSentryRelease ( buildContext . buildId ) } ,
955+ SENTRY_RELEASE : buildContext . dev
956+ ? undefined
957+ : { id : sentryWebpackPluginOptions . release ?? getSentryRelease ( buildContext . buildId ) } ,
955958 } ;
956959
957960 const serverValues = {
0 commit comments