-
-
Notifications
You must be signed in to change notification settings - Fork 73
/
Makefile
35 lines (27 loc) · 1.34 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
.PHONY: clean
clean:
rm -rf chromium.zip _/amazon/code/nodejs _/amazon/handlers/node_modules
pretest:
unzip chromium.zip -d _/amazon/code
npm install --prefix _/amazon/handlers puppeteer-core@latest --bin-links=false --fund=false --omit=optional --omit=dev --package-lock=false --save=false
test:
sam local invoke --template _/amazon/template.yml --event _/amazon/events/example.com.json node22
test16:
sam local invoke --template _/amazon/template.yml --event _/amazon/events/example.com.json node16
test18:
sam local invoke --template _/amazon/template.yml --event _/amazon/events/example.com.json node18
test20:
sam local invoke --template _/amazon/template.yml --event _/amazon/events/example.com.json node20
%.zip:
npm install --fund=false --package-lock=false
npm run build
mkdir -p nodejs
npm install --prefix nodejs/ tar-fs@3.0.6 follow-redirects@1.15.9 --bin-links=false --fund=false --omit=optional --omit=dev --package-lock=false --save=false
npm pack
mkdir -p nodejs/node_modules/@sparticuz/chromium/
tar --directory nodejs/node_modules/@sparticuz/chromium/ --extract --file sparticuz-chromium-*.tgz --strip-components=1
npx clean-modules --directory nodejs "**/*.d.ts" "**/@types/**" "**/*.@(yaml|yml)" --yes
rm sparticuz-chromium-*.tgz
mkdir -p $(dir $@)
zip -9 --filesync --move --recurse-paths $@ nodejs
.DEFAULT_GOAL := chromium.zip