Skip to content

Commit 7630ab4

Browse files
committed
add a helper for how serverless function config is defined
1 parent ab76a7d commit 7630ab4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/build/functions/server.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export const createServerHandler = async (ctx: PluginContext) => {
145145
await copyNextServerCode(ctx)
146146
await copyNextDependencies(ctx)
147147
await copyHandlerDependencies(ctx)
148-
if (!ctx.useFrameworksAPI) {
148+
if (ctx.serverHandlerConfigStrategy === 'manifest') {
149149
await writeHandlerManifest(ctx)
150150
}
151151
await writeHandlerFile(ctx)

src/build/plugin-context.ts

+4
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ export class PluginContext {
244244
return './.netlify/dist/run/handlers/server.js'
245245
}
246246

247+
get serverHandlerConfigStrategy(): 'manifest' | 'inline' {
248+
return this.useFrameworksAPI ? 'inline' : 'manifest'
249+
}
250+
247251
/**
248252
* Absolute path of the directory containing the files for deno edge functions
249253
* frameworks api: `.netlify/v1/edge-functions`

0 commit comments

Comments
 (0)