File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -8,21 +8,23 @@ import type { NextConfigComplete } from 'next/dist/server/config-shared.js'
8
8
9
9
import { handleCacheControl , handleVary } from '../helpers/headers.js'
10
10
11
+ // use require to stop NFT from trying to trace these dependencies
11
12
const require = createRequire ( import . meta. url )
12
13
13
14
/* these dependencies are generated during the build */
14
15
// eslint-disable-next-line import/order
15
16
const { getRequestHandlers } = require ( 'next/dist/server/lib/start-server.js' )
16
17
const requiredServerFiles = require ( '../../.next/required-server-files.json' )
17
18
19
+ // read Next config from the build output
18
20
process . env . __NEXT_PRIVATE_STANDALONE_CONFIG = JSON . stringify ( requiredServerFiles . config )
19
-
20
21
const nextConfig = requiredServerFiles . config as NextConfigComplete
21
22
23
+ // run the server in the root directory
22
24
const __dirname = fileURLToPath ( new URL ( '../..' , import . meta. url ) )
23
-
24
25
process . chdir ( __dirname )
25
26
27
+ // memoize the node bridge instance
26
28
let bridge : Bridge
27
29
28
30
export const handler : Handler = async function ( event : HandlerEvent , context : HandlerContext ) {
You can’t perform that action at this time.
0 commit comments