@@ -24,7 +24,10 @@ import {
2424} from "config/util.js" ;
2525import { getCrossPlatformPathRegex } from "utils/regex.js" ;
2626import 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" ;
2831
2932const __dirname = url . fileURLToPath ( new URL ( "." , import . meta. url ) ) ;
3033
@@ -190,13 +193,25 @@ File ${fullFilePath} does not exist
190193 }
191194 } ;
192195
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+
193207 if ( existsSync ( path . join ( dotNextDir , MIDDLEWARE_TRACE_FILE ) ) ) {
194208 // We still need to copy the nft.json file so that computeCopyFilesForPage doesn't throw
195209 copyFileSync (
196210 path . join ( dotNextDir , MIDDLEWARE_TRACE_FILE ) ,
197211 path . join ( standaloneNextDir , MIDDLEWARE_TRACE_FILE ) ,
198212 ) ;
199213 computeCopyFilesForPage ( "middleware" ) ;
214+ logger . debug ( "Adding node middleware trace files" ) ;
200215 }
201216
202217 const hasPageDir = routes . some ( ( route ) => route . startsWith ( "pages/" ) ) ;
0 commit comments