@@ -67,8 +67,6 @@ function getFinalConfigObject(
67
67
}
68
68
}
69
69
70
- setUpBuildTimeVariables ( incomingUserNextConfigObject , userSentryOptions , releaseName ) ;
71
-
72
70
const nextJsVersion = getNextjsVersion ( ) ;
73
71
74
72
// Add the `clientTraceMetadata` experimental option based on Next.js version. The option got introduced in Next.js version 15.0.0 (actually 14.3.0-canary.64).
@@ -287,64 +285,6 @@ function setUpTunnelRewriteRules(userNextConfig: NextConfigObject, tunnelPath: s
287
285
} ;
288
286
}
289
287
290
- function setUpBuildTimeVariables (
291
- userNextConfig : NextConfigObject ,
292
- userSentryOptions : SentryBuildOptions ,
293
- releaseName : string | undefined ,
294
- ) : void {
295
- const assetPrefix = userNextConfig . assetPrefix || userNextConfig . basePath || '' ;
296
- const basePath = userNextConfig . basePath ?? '' ;
297
- const rewritesTunnelPath =
298
- userSentryOptions . tunnelRoute !== undefined && userNextConfig . output !== 'export'
299
- ? `${ basePath } ${ userSentryOptions . tunnelRoute } `
300
- : undefined ;
301
-
302
- const buildTimeVariables : Record < string , string > = {
303
- // Make sure that if we have a windows path, the backslashes are interpreted as such (rather than as escape
304
- // characters)
305
- _sentryRewriteFramesDistDir : userNextConfig . distDir ?. replace ( / \\ / g, '\\\\' ) || '.next' ,
306
- // Get the path part of `assetPrefix`, minus any trailing slash. (We use a placeholder for the origin if
307
- // `assetPrefix` doesn't include one. Since we only care about the path, it doesn't matter what it is.)
308
- _sentryRewriteFramesAssetPrefixPath : assetPrefix
309
- ? new URL ( assetPrefix , 'http://dogs.are.great' ) . pathname . replace ( / \/ $ / , '' )
310
- : '' ,
311
- } ;
312
-
313
- if ( userNextConfig . assetPrefix ) {
314
- buildTimeVariables . _assetsPrefix = userNextConfig . assetPrefix ;
315
- }
316
-
317
- if ( userSentryOptions . _experimental ?. thirdPartyOriginStackFrames ) {
318
- buildTimeVariables . _experimentalThirdPartyOriginStackFrames = 'true' ;
319
- }
320
-
321
- if ( rewritesTunnelPath ) {
322
- buildTimeVariables . _sentryRewritesTunnelPath = rewritesTunnelPath ;
323
- }
324
-
325
- if ( basePath ) {
326
- buildTimeVariables . _sentryBasePath = basePath ;
327
- }
328
-
329
- if ( userNextConfig . assetPrefix ) {
330
- buildTimeVariables . _sentryAssetPrefix = userNextConfig . assetPrefix ;
331
- }
332
-
333
- if ( userSentryOptions . _experimental ?. thirdPartyOriginStackFrames ) {
334
- buildTimeVariables . _experimentalThirdPartyOriginStackFrames = 'true' ;
335
- }
336
-
337
- if ( releaseName ) {
338
- buildTimeVariables . _sentryRelease = releaseName ;
339
- }
340
-
341
- if ( typeof userNextConfig . env === 'object' ) {
342
- userNextConfig . env = { ...buildTimeVariables , ...userNextConfig . env } ;
343
- } else if ( userNextConfig . env === undefined ) {
344
- userNextConfig . env = buildTimeVariables ;
345
- }
346
- }
347
-
348
288
function getGitRevision ( ) : string | undefined {
349
289
let gitRevision : string | undefined ;
350
290
try {
0 commit comments