@@ -16,7 +16,10 @@ import path from "node:path";
1616import { loadConfig , loadPrerenderManifest } from "config/util.js" ;
1717import { getCrossPlatformPathRegex } from "utils/regex.js" ;
1818import logger from "../logger.js" ;
19- import { MIDDLEWARE_TRACE_FILE } from "./constant.js" ;
19+ import {
20+ INSTRUMENTATION_TRACE_FILE ,
21+ MIDDLEWARE_TRACE_FILE ,
22+ } from "./constant.js" ;
2023
2124const __dirname = url . fileURLToPath ( new URL ( "." , import . meta. url ) ) ;
2225
@@ -170,13 +173,25 @@ File ${fullFilePath} does not exist
170173 }
171174 } ;
172175
176+ // Check for instrumentation trace file
177+ if ( existsSync ( path . join ( dotNextDir , INSTRUMENTATION_TRACE_FILE ) ) ) {
178+ // We still need to copy the nft.json file so that computeCopyFilesForPage doesn't throw
179+ copyFileSync (
180+ path . join ( dotNextDir , INSTRUMENTATION_TRACE_FILE ) ,
181+ path . join ( standaloneNextDir , INSTRUMENTATION_TRACE_FILE ) ,
182+ ) ;
183+ computeCopyFilesForPage ( "instrumentation" ) ;
184+ logger . debug ( "Adding instrumentation trace files" ) ;
185+ }
186+
173187 if ( existsSync ( path . join ( dotNextDir , MIDDLEWARE_TRACE_FILE ) ) ) {
174188 // We still need to copy the nft.json file so that computeCopyFilesForPage doesn't throw
175189 copyFileSync (
176190 path . join ( dotNextDir , MIDDLEWARE_TRACE_FILE ) ,
177191 path . join ( standaloneNextDir , MIDDLEWARE_TRACE_FILE ) ,
178192 ) ;
179193 computeCopyFilesForPage ( "middleware" ) ;
194+ logger . debug ( "Adding node middleware trace files" ) ;
180195 }
181196
182197 const hasPageDir = routes . some ( ( route ) => route . startsWith ( "pages/" ) ) ;
0 commit comments