Skip to content

Commit a9dc2d5

Browse files
authored
add lambda options support (#116)
1 parent d224204 commit a9dc2d5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/index.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
Lambda,
99
type BuildOptions,
1010
type BuildResultV2Typical,
11+
getLambdaOptionsFromFunction,
1112
} from '@vercel/build-utils';
1213
import execa from 'execa';
1314
import { installRustToolchain } from './lib/rust-toolchain';
@@ -40,7 +41,8 @@ async function buildHandler(
4041
const downloadedFiles = await download(files, workPath, meta);
4142
const entryPath = downloadedFiles[entrypoint].fsPath;
4243

43-
const HOME = process.platform === 'win32' ? assertEnv('USERPROFILE') : assertEnv('HOME');
44+
const HOME =
45+
process.platform === 'win32' ? assertEnv('USERPROFILE') : assertEnv('HOME');
4446
const PATH = assertEnv('PATH');
4547

4648
const rustEnv: RustEnv = {
@@ -96,6 +98,11 @@ async function buildHandler(
9698
getExecutableName(binaryName),
9799
);
98100

101+
const lambdaOptions = await getLambdaOptionsFromFunction({
102+
sourceFile: entrypoint,
103+
config,
104+
});
105+
99106
const bootstrap = getExecutableName('bootstrap');
100107
const lambda = new Lambda({
101108
files: {
@@ -104,6 +111,7 @@ async function buildHandler(
104111
},
105112
handler: bootstrap,
106113
runtime: 'provided',
114+
...lambdaOptions,
107115
});
108116
lambda.zipBuffer = await lambda.createZip();
109117

0 commit comments

Comments
 (0)