@@ -7,6 +7,7 @@ import * as fs from 'fs';
77import * as path from 'path' ;
88import { sync as resolveSync } from 'resolve' ;
99import type { VercelCronsConfig } from '../common/types' ;
10+ import type { RouteManifest } from './manifest/types' ;
1011// Note: If you need to import a type from Webpack, do it in `types.ts` and export it from there. Otherwise, our
1112// circular dependency check thinks this file is importing from itself. See https://github.com/pahen/madge/issues/306.
1213import type {
@@ -43,6 +44,7 @@ export function constructWebpackConfigFunction(
4344 userNextConfig : NextConfigObject = { } ,
4445 userSentryOptions : SentryBuildOptions = { } ,
4546 releaseName : string | undefined ,
47+ routeManifest : RouteManifest | undefined ,
4648) : WebpackConfigFunction {
4749 // Will be called by nextjs and passed its default webpack configuration and context data about the build (whether
4850 // 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(
8890 const newConfig = setUpModuleRules ( rawNewConfig ) ;
8991
9092 // 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 ) ;
9294
9395 addOtelWarningIgnoreRule ( newConfig ) ;
9496
@@ -686,6 +688,7 @@ function addValueInjectionLoader(
686688 userSentryOptions : SentryBuildOptions ,
687689 buildContext : BuildContext ,
688690 releaseName : string | undefined ,
691+ routeManifest : RouteManifest | undefined ,
689692) : void {
690693 const assetPrefix = userNextConfig . assetPrefix || userNextConfig . basePath || '' ;
691694
@@ -727,6 +730,7 @@ function addValueInjectionLoader(
727730 _sentryExperimentalThirdPartyOriginStackFrames : userSentryOptions . _experimental ?. thirdPartyOriginStackFrames
728731 ? 'true'
729732 : undefined ,
733+ _sentryRouteManifest : JSON . stringify ( routeManifest ) ,
730734 } ;
731735
732736 if ( buildContext . isServer ) {
0 commit comments