Webpack Bundle vs. Layer

Hi all, which way do you use to optimize the lambda functions?

Extracting dependencies into layers seem to be an approach recommended by AWS, but it would upload the whole modules. While webpack bundle would only keep the code needed.

For examples, let’s say there is a minimal service which take aws-sdk as dependency.

  • Webpack bundle: 2-3mb after bundled
  • Layer: Lambda 10kb yet Layer would be 10mb+

I’d ultimately like to use this service quite a bit and deploy Lambda functions linking to various S3 buckets for more automation
snaptube vidmate word to pdf