Skip to content

Commit 4259dfc

Browse files
add back missing name field
1 parent e690889 commit 4259dfc

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

packages/cloudflare/src/cli/build/patches/plugins/instrumentation.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ export function patchInstrumentation(updater: ContentUpdater, buildOpts: BuildOp
1414
{ filter: /\.(js|mjs|cjs|jsx|ts|tsx)$/, contentFilter: /async loadInstrumentationModule\(/ },
1515
async ({ contents }) => patchCode(contents, getNext15Rule(builtInstrumentationPath))
1616
);
17-
17+
1818
updater.updateContent(
1919
"patch-instrumentation-next14",
2020
{ filter: /\.(js|mjs|cjs|jsx|ts|tsx)$/, contentFilter: /async prepareImpl\(/ },
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) {
7171
function 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

Comments
 (0)