Skip to content

Commit de33423

Browse files
committed
chore: creating cache file right before config set
1 parent b28b201 commit de33423

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/runtime/src/helpers/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { join, dirname, relative } from 'pathe'
77
import slash from 'slash'
88

99
import { HANDLER_FUNCTION_NAME, IMAGE_FUNCTION_NAME, ODB_FUNCTION_NAME } from '../constants'
10+
import { generateCacheHandler } from '../templates/getCacheHandler'
1011

1112
import type { APILambda, SSRLambda } from './functions'
1213
import type { RoutesManifest } from './types'
@@ -55,6 +56,8 @@ export const getNextConfig = async function getNextConfig({
5556
)
5657
}
5758

59+
await generateCacheHandler(INTERNAL_FUNCTIONS_SRC)
60+
5861
// For more info, see https://nextjs.org/docs/app/api-reference/next-config-js/incrementalCacheHandlerPath
5962
// ./cache-handler.js will be copied to the root or the .next build folder
6063

packages/runtime/src/helpers/functions.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
LAMBDA_WARNING_SIZE,
2323
} from '../constants'
2424
import { getApiHandler } from '../templates/getApiHandler'
25-
import { generateCacheHandler } from '../templates/getCacheHandler'
2625
import { getHandler } from '../templates/getHandler'
2726
import { getResolverForPages, getResolverForSourceFiles } from '../templates/getPageResolver'
2827

@@ -169,7 +168,6 @@ export const generateFunctions = async (
169168

170169
await writeHandler(HANDLER_FUNCTION_NAME, HANDLER_FUNCTION_TITLE, false)
171170
await writeHandler(ODB_FUNCTION_NAME, ODB_FUNCTION_TITLE, true)
172-
await generateCacheHandler(functionsDir)
173171
}
174172

175173
/**

0 commit comments

Comments
 (0)