Created
October 11, 2023 07:47
-
-
Save michaelwittig/ed07182f28728c9ccfc05540d89c24b3 to your computer and use it in GitHub Desktop.
Build code for inline CloudFormation Lambda functions (can be used with CDK)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function zipFile(lambdaFile) { | |
return esbuild.buildSync({ | |
entryPoints: [`lambda/${lambdaFile}`], // your path might be different | |
external: ['@aws-sdk/*'], | |
target: ['node18'], | |
platform: 'node', | |
bundle: true, | |
write: false, | |
treeShaking: true | |
}).outputFiles[0].text; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment