Skip to content

Instantly share code, notes, and snippets.

@alfredwesterveld
Created March 9, 2021 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alfredwesterveld/6cc90b31cb1ea0dd45824bae506fd919 to your computer and use it in GitHub Desktop.
Save alfredwesterveld/6cc90b31cb1ea0dd45824bae506fd919 to your computer and use it in GitHub Desktop.
makefile chrome-aws-lambda
.PHONY: clean
clean:
rm -f $(lastword $(MAKECMDGOALS))
.fonts.zip:
zip -9 --filesync --move --recurse-paths .fonts.zip .fonts/
%.zip:
mkdir -p nodejs/node_modules/chrome-aws-lambda/
cd nodejs/ && npm install lambdafs@~2.0.2 puppeteer-core@~7.0.1 --no-bin-links --no-optional --no-package-lock --no-save --no-shrinkwrap && cd -
mkdir -p nodejs/node_modules/chrome-aws-lambda/
npm pack
tar --directory nodejs/node_modules/chrome-aws-lambda/ --extract --file chrome-aws-lambda-*.tgz --strip-components=1
rm chrome-aws-lambda-*.tgz
mkdir -p $(dir $@)
zip -9 --filesync --move --recurse-paths $@ nodejs/
.DEFAULT_GOAL := chrome_aws_lambda.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment