@@ -14,15 +14,15 @@ export function patchInstrumentation(updater: ContentUpdater, buildOpts: BuildOp
1414 { filter : / \. ( j s | m j s | c j s | j s x | t s | t s x ) $ / , contentFilter : / a s y n c l o a d I n s t r u m e n t a t i o n M o d u l e \( / } ,
1515 async ( { contents } ) => patchCode ( contents , getNext15Rule ( builtInstrumentationPath ) )
1616 ) ;
17-
17+
1818 updater . updateContent (
1919 "patch-instrumentation-next14" ,
2020 { filter : / \. ( j s | m j s | c j s | j s x | t s | t s x ) $ / , contentFilter : / a s y n c p r e p a r e I m p l \( / } ,
2121 async ( { contents } ) => patchCode ( contents , getNext14Rule ( builtInstrumentationPath ) )
2222 ) ;
2323
2424 return {
25- "patch-instrumentation" ,
25+ name : "patch-instrumentation" ,
2626 setup ( ) { } ,
2727 } ;
2828}
@@ -71,10 +71,13 @@ export function getNext14Rule(builtInstrumentationPath: string | null) {
7171function getBuiltInstrumentationPath ( buildOpts : BuildOptions ) : string | null {
7272 const { outputDir } = buildOpts ;
7373
74- const maybeBuiltInstrumentationPath = join ( outputDir , "server-functions/default" , getPackagePath ( buildOpts ) , `.next/server/${ INSTRUMENTATION_HOOK_FILENAME } .js` ) ;
75- return existsSync ( maybeBuiltInstrumentationPath )
76- ? maybeBuiltInstrumentationPath
77- : null ;
74+ const maybeBuiltInstrumentationPath = join (
75+ outputDir ,
76+ "server-functions/default" ,
77+ getPackagePath ( buildOpts ) ,
78+ `.next/server/${ INSTRUMENTATION_HOOK_FILENAME } .js`
79+ ) ;
80+ return existsSync ( maybeBuiltInstrumentationPath ) ? maybeBuiltInstrumentationPath : null ;
7881}
7982
8083/**
0 commit comments