@@ -7,7 +7,7 @@ import * as path from 'path';
7
7
8
8
const SENTRY_CLIENT_CONFIG_FILE = './sentry.client.config.js' ;
9
9
const SENTRY_SERVER_CONFIG_FILE = './sentry.server.config.js' ;
10
- // this is where the transpiled/bundled version of `USER_SERVER_CONFIG_FILE ` will end up
10
+ // this is where the transpiled/bundled version of `SENTRY_SERVER_CONFIG_FILE ` will end up
11
11
export const SERVER_SDK_INIT_PATH = 'sentry/initServerSDK.js' ;
12
12
13
13
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -21,7 +21,7 @@ type WebpackConfig = {
21
21
devtool : string ;
22
22
plugins : PlainObject [ ] ;
23
23
entry : EntryProperty ;
24
- output : { path : string } ;
24
+ output : { filename : string ; path : string } ;
25
25
target : string ;
26
26
context : string ;
27
27
} ;
@@ -156,7 +156,8 @@ export function withSentryConfig(
156
156
// if we're building server code, store the webpack output path as an env variable, so we know where to look for the
157
157
// webpack-processed version of `sentry.server.config.js` when we need it
158
158
if ( config . target === 'node' ) {
159
- const serverSDKInitOutputPath = path . join ( config . output . path , SERVER_SDK_INIT_PATH ) ;
159
+ const outputLocation = path . dirname ( path . join ( config . output . path , config . output . filename ) ) ;
160
+ const serverSDKInitOutputPath = path . join ( outputLocation , SERVER_SDK_INIT_PATH ) ;
160
161
const projectDir = config . context ;
161
162
setRuntimeEnvVars ( projectDir , {
162
163
// ex: .next/server/sentry/initServerSdk.js
0 commit comments