Skip to content

Instantly share code, notes, and snippets.

@pepoviola
Created October 24, 2019 20:05
Show Gist options
  • Save pepoviola/1816780c01954cb0fda178380caafe14 to your computer and use it in GitHub Desktop.
Save pepoviola/1816780c01954cb0fda178380caafe14 to your computer and use it in GitHub Desktop.
Add Google Chrome for AWS Lambda as dependency in your function.
# Add Google Chrome for AWS Lambda as dependency in your function.
# based on https://github.com/alixaxel/chrome-aws-lambda#aws-lambda-layer
nvm use lts/dubnium
mkdir -p node_modules/chrome-aws-lambda/
npm install lambdafs@~1.3.0 puppeteer-core@~1.20.0 --no-bin-links --no-optional --no-package-lock --no-save --no-shrinkwrap
npm pack chrome-aws-lambda
tar --directory node_modules/chrome-aws-lambda/ --extract --file chrome-aws-lambda-*.tgz --strip-components=1
rm chrome-aws-lambda-*.tgz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment