@@ -24,7 +24,10 @@ import {
24
24
} from "config/util.js" ;
25
25
import { getCrossPlatformPathRegex } from "utils/regex.js" ;
26
26
import logger from "../logger.js" ;
27
- import { MIDDLEWARE_TRACE_FILE } from "./constant.js" ;
27
+ import {
28
+ INSTRUMENTATION_TRACE_FILE ,
29
+ MIDDLEWARE_TRACE_FILE ,
30
+ } from "./constant.js" ;
28
31
29
32
const __dirname = url . fileURLToPath ( new URL ( "." , import . meta. url ) ) ;
30
33
@@ -190,13 +193,25 @@ File ${fullFilePath} does not exist
190
193
}
191
194
} ;
192
195
196
+ // Check for instrumentation trace file
197
+ if ( existsSync ( path . join ( dotNextDir , INSTRUMENTATION_TRACE_FILE ) ) ) {
198
+ // We still need to copy the nft.json file so that computeCopyFilesForPage doesn't throw
199
+ copyFileSync (
200
+ path . join ( dotNextDir , INSTRUMENTATION_TRACE_FILE ) ,
201
+ path . join ( standaloneNextDir , INSTRUMENTATION_TRACE_FILE ) ,
202
+ ) ;
203
+ computeCopyFilesForPage ( "instrumentation" ) ;
204
+ logger . debug ( "Adding instrumentation trace files" ) ;
205
+ }
206
+
193
207
if ( existsSync ( path . join ( dotNextDir , MIDDLEWARE_TRACE_FILE ) ) ) {
194
208
// We still need to copy the nft.json file so that computeCopyFilesForPage doesn't throw
195
209
copyFileSync (
196
210
path . join ( dotNextDir , MIDDLEWARE_TRACE_FILE ) ,
197
211
path . join ( standaloneNextDir , MIDDLEWARE_TRACE_FILE ) ,
198
212
) ;
199
213
computeCopyFilesForPage ( "middleware" ) ;
214
+ logger . debug ( "Adding node middleware trace files" ) ;
200
215
}
201
216
202
217
const hasPageDir = routes . some ( ( route ) => route . startsWith ( "pages/" ) ) ;
0 commit comments