@@ -7,6 +7,7 @@ import * as fs from 'fs';
7
7
import * as path from 'path' ;
8
8
import { sync as resolveSync } from 'resolve' ;
9
9
import type { VercelCronsConfig } from '../common/types' ;
10
+ import type { RouteManifest } from './manifest/types' ;
10
11
// Note: If you need to import a type from Webpack, do it in `types.ts` and export it from there. Otherwise, our
11
12
// circular dependency check thinks this file is importing from itself. See https://github.com/pahen/madge/issues/306.
12
13
import type {
@@ -43,6 +44,7 @@ export function constructWebpackConfigFunction(
43
44
userNextConfig : NextConfigObject = { } ,
44
45
userSentryOptions : SentryBuildOptions = { } ,
45
46
releaseName : string | undefined ,
47
+ routeManifest : RouteManifest | undefined ,
46
48
) : WebpackConfigFunction {
47
49
// Will be called by nextjs and passed its default webpack configuration and context data about the build (whether
48
50
// we're building server or client, whether we're in dev, what version of webpack we're using, etc). Note that
@@ -88,7 +90,7 @@ export function constructWebpackConfigFunction(
88
90
const newConfig = setUpModuleRules ( rawNewConfig ) ;
89
91
90
92
// Add a loader which will inject code that sets global values
91
- addValueInjectionLoader ( newConfig , userNextConfig , userSentryOptions , buildContext , releaseName ) ;
93
+ addValueInjectionLoader ( newConfig , userNextConfig , userSentryOptions , buildContext , releaseName , routeManifest ) ;
92
94
93
95
addOtelWarningIgnoreRule ( newConfig ) ;
94
96
@@ -686,6 +688,7 @@ function addValueInjectionLoader(
686
688
userSentryOptions : SentryBuildOptions ,
687
689
buildContext : BuildContext ,
688
690
releaseName : string | undefined ,
691
+ routeManifest : RouteManifest | undefined ,
689
692
) : void {
690
693
const assetPrefix = userNextConfig . assetPrefix || userNextConfig . basePath || '' ;
691
694
@@ -727,6 +730,7 @@ function addValueInjectionLoader(
727
730
_sentryExperimentalThirdPartyOriginStackFrames : userSentryOptions . _experimental ?. thirdPartyOriginStackFrames
728
731
? 'true'
729
732
: undefined ,
733
+ _sentryRouteManifest : JSON . stringify ( routeManifest ) ,
730
734
} ;
731
735
732
736
if ( buildContext . isServer ) {
0 commit comments