This AWS lambda layer contains a pre-built sharp npm library.
| Sharp version | Layer size | Zipped size |
|---|---|---|
| 0.25.1 | 26MB | 9.9MB |
A built lambda zip file is available at dist/sharp-layer.zip.
- Docker
- Clone the repo:
git clone git@github.com:Umkus/lambda-layer-sharp.git cd lambda-layer-sharp/ - Install dependencies:
docker run -v "$PWD":/var/task lambci/lambda:build-nodejs12.x npm ci - Build the layer:
docker run -v "$PWD":/var/task lambci/lambda:build-nodejs12.x node ./node_modules/webpack/bin/webpack.js - Import created layer into your AWS account:
aws lambda publish-layer-version \ --layer-name sharp --description "Sharp layer" \ --license-info "Apache License 2.0" \ --zip-file fileb://dist/sharp-layer.zip \ --compatible-runtimes nodejs12