File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
packages/nextjs-cache-handler/src/instrumentation Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,12 @@ export type RegisterInitialCacheOptions = {
4747 * @default true
4848 */
4949 routes ?: boolean ;
50+ /**
51+ * Override the default build directory.
52+ *
53+ * @default .next
54+ */
55+ buildDir ?: string ;
5056} ;
5157
5258/**
@@ -89,7 +95,7 @@ export async function registerInitialCache(
8995 options : RegisterInitialCacheOptions = { } ,
9096) {
9197 const debug = typeof process . env . NEXT_PRIVATE_DEBUG_CACHE !== "undefined" ;
92- const nextJsPath = path . join ( process . cwd ( ) , ".next" ) ;
98+ const nextJsPath = path . join ( process . cwd ( ) , options . buildDir ?? ".next" ) ;
9399 const prerenderManifestPath = path . join ( nextJsPath , PRERENDER_MANIFEST ) ;
94100 const serverDistDir = path . join ( nextJsPath , SERVER_DIRECTORY ) ;
95101 const fetchCacheDir = path . join ( nextJsPath , "cache" , "fetch-cache" ) ;
You can’t perform that action at this time.
0 commit comments