Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 1.13 KB

README.md

File metadata and controls

38 lines (28 loc) · 1.13 KB

Working pnpm monorepo for AWS Lambda

on Linux:

  • git clone https://github.com/UROjQ6r80p/pnpm-aws-monorepo
  • cd pnpm-aws-monorepo
  • pnpm install
  • cd services/aws-lambda
  • pnpm --filter=aws-lambda --prod deploy dist
  • cd dist
  • zip --symlinks -r dist.zip ./
  • Upload dist.zip to aws lambda.

No node-linker=hoisted, default pnpm config used.

No unneccessary modules from other packages bloating your lambda.

image

Lambda:

image

on Windows (zip tools do not support symlinks on Windows)

  • download 7zip
  • git clone https://github.com/UROjQ6r80p/pnpm-aws-monorepo
  • cd pnpm-aws-monorepo
  • pnpm install
  • cd services/aws-lambda
  • pnpm --filter=aws-lambda --prod deploy dist
  • zip a -snl -ttar dist dist/ will be saved to dist.tar
  • copy dist.tar to Linux system. I use WSL
  • on Linux unpack tar tar -xvf dist.tar
  • cd dist
  • zip --symlinks -r dist.zip ./
  • Upload dist.zip to AWS Lambda.