Skip to content

Commit 8b9e27f

Browse files
committed
fix: cache handler path
1 parent a2f71c5 commit 8b9e27f

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/helpers/functions.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,13 @@ export const createServerHandler = async (publishDir: string, config: NetlifyCon
3131
}
3232

3333
const copyServerHandlerDependencies = async (pluginDir: string) => {
34-
const { fileList } = await nodeFileTrace([`${pluginDir}/dist/templates/server-handler.js`], {
35-
base: pluginDir,
36-
ignore: ['package.json'],
37-
})
34+
const { fileList } = await nodeFileTrace(
35+
[`${pluginDir}/dist/templates/server-handler.js`, `${pluginDir}/dist/templates/cache-handler.cjs`],
36+
{
37+
base: pluginDir,
38+
ignore: ['package.json'],
39+
},
40+
)
3841

3942
fileList.forEach((path) => {
4043
copySync(`${pluginDir}/${path}`, `${SERVER_HANDLER_DIR}/${path}`)

src/templates/server-handler.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ const require = createRequire(import.meta.url)
1616
const { getRequestHandlers } = require('next/dist/server/lib/start-server.js')
1717
const requiredServerFiles = require('../../.next/required-server-files.json')
1818

19+
requiredServerFiles.config.experimental = {
20+
...requiredServerFiles.config.experimental,
21+
incrementalCacheHandlerPath: '../dist/templates/cache-handler.cjs',
22+
}
23+
1924
// read Next config from the build output
2025
process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(requiredServerFiles.config)
2126
const nextConfig = requiredServerFiles.config as NextConfigComplete

0 commit comments

Comments
 (0)