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.
Lambda:
- 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 todist.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.