@@ -81,7 +81,7 @@ export function constructWebpackConfigFunction(
81
81
const newConfig = setUpModuleRules ( rawNewConfig ) ;
82
82
83
83
// Add a loader which will inject code that sets global values
84
- addValueInjectionLoader ( newConfig , userNextConfig , userSentryOptions , buildContext ) ;
84
+ addValueInjectionLoader ( newConfig , userNextConfig , userSentryOptions , buildContext , userSentryWebpackPluginOptions ) ;
85
85
86
86
newConfig . module . rules . push ( {
87
87
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(
939
939
userNextConfig : NextConfigObject ,
940
940
userSentryOptions : UserSentryOptions ,
941
941
buildContext : BuildContext ,
942
+ sentryWebpackPluginOptions : Partial < SentryWebpackPluginOptions > ,
942
943
) : void {
943
944
const assetPrefix = userNextConfig . assetPrefix || userNextConfig . basePath || '' ;
944
945
@@ -951,7 +952,9 @@ function addValueInjectionLoader(
951
952
952
953
// The webpack plugin's release injection breaks the `app` directory so we inject the release manually here instead.
953
954
// 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 ) } ,
955
958
} ;
956
959
957
960
const serverValues = {
0 commit comments