Skip to content

Instantly share code, notes, and snippets.

@mxro
Created November 26, 2021 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mxro/03a0e05268c10cb1c2bdcd96980fc993 to your computer and use it in GitHub Desktop.
Save mxro/03a0e05268c10cb1c2bdcd96980fc993 to your computer and use it in GitHub Desktop.
import { build } from 'esbuild';
import { pnpPlugin } from '@yarnpkg/esbuild-plugin-pnp';
build({
plugins: [pnpPlugin()],
bundle: true,
entryPoints: ['src/lambda.ts'],
external: ['aws-sdk'],
minify: true,
format: 'cjs',
target: 'node12.0',
sourcemap: true,
outfile: 'distLambda/lambda.js',
}).catch((e) => {
console.log('Build not successful', e.message);
process.exit(1);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment