GitHub - alexkrkn/lambda-build: Bundle, archive and upload your lambda functions

1 min read Original article ↗

npx lambda-build archive bundles your code and creates a local archive.zip file that you can then upload to aws yourself.

npx lambda-build upload bundles your code and then uploads it directly to your AWS lambda functions (requires the aws cli to be locally configured).

import { build } from 'lambda-build';

const res = await build({
  entry: 'src/index.js',
  external: ['lodash', 'dayjs'],
  metafile: true,
});
import { buildAndUpload } from 'lambda-build';

const res = await buildAndUpload({
  entry: 'src/index.js',
  external: ['lodash', 'dayjs'],
  metafile: true,
  lambdas: ['my-lambda1', 'my-lambda2'],
  region: 'us-east-2',
});