Skip to content

Commit

Permalink
fix(vercel): allow arbitrary function configuration (#1508)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 authored Jul 29, 2023
1 parent 958c9a1 commit 4c4afd3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/presets/vercel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ export const vercel = defineNitroPreset({

const systemNodeVersion = process.versions.node.split(".")[0];
const runtimeVersion = `nodejs${systemNodeVersion}.x`;
const customMemory = nitro.options.vercel?.functions?.memory;
const customMaxDuration = nitro.options.vercel?.functions?.maxDuration;
const functionConfigPath = resolve(
nitro.options.output.serverDir,
".vc-config.json"
Expand All @@ -43,8 +41,7 @@ export const vercel = defineNitroPreset({
handler: "index.mjs",
launcherType: "Nodejs",
shouldAddHelpers: false,
memory: customMemory,
maxDuration: customMaxDuration,
...nitro.options.vercel?.functions,
};
await writeFile(
functionConfigPath,
Expand Down
1 change: 1 addition & 0 deletions src/types/presets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export interface PresetOptions {
functions?: {
memory: number;
maxDuration: number;
[key: string]: unknown;
};
};
}

0 comments on commit 4c4afd3

Please sign in to comment.