Skip to content

Commit 76ce21a

Browse files
committed
review fix
1 parent b2a7d7b commit 76ce21a

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

packages/open-next/src/adapters/composable-cache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default {
99
cacheKey,
1010
"composable",
1111
);
12-
if (!result || !result.value?.value) {
12+
if (!result?.value?.value) {
1313
return undefined;
1414
}
1515

packages/open-next/src/build/compileCache.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as buildHelper from "./helper.js";
77
*
88
* @param options Build options.
99
* @param format Output format.
10-
* @returns The path to the compiled file.
10+
* @returns An object containing the paths to the compiled cache and composable cache files.
1111
*/
1212
export function compileCache(
1313
options: buildHelper.BuildOptions,
@@ -16,10 +16,6 @@ export function compileCache(
1616
const { config } = options;
1717
const ext = format === "cjs" ? "cjs" : "mjs";
1818
const compiledCacheFile = path.join(options.buildDir, `cache.${ext}`);
19-
const compiledComposableCacheFile = path.join(
20-
options.buildDir,
21-
`composable-cache.${ext}`,
22-
);
2319

2420
const isAfter15 = buildHelper.compareSemver(
2521
options.nextVersion,
@@ -50,6 +46,11 @@ export function compileCache(
5046
options,
5147
);
5248

49+
const compiledComposableCacheFile = path.join(
50+
options.buildDir,
51+
`composable-cache.${ext}`,
52+
);
53+
5354
// Composable cache
5455
buildHelper.esbuildSync(
5556
{

packages/open-next/src/build/patch/patches/patchFetchCacheISR.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export const patchUseCacheForISR: CodePatcher = {
142142
versions: ">=15.3.0",
143143
field: {
144144
pathFilter: getCrossPlatformPathRegex(
145-
String.raw`(server/chunks/.*\.js|.*\.runtime\..*\.js|use-cache/use-cache-wrapper\.js)$`,
145+
String.raw`(server/chunks/.*\.js|\.runtime\..*\.js|use-cache/use-cache-wrapper\.js)$`,
146146
{ escape: false },
147147
),
148148
contentFilter: /\.isOnDemandRevalidate/,

0 commit comments

Comments
 (0)