Skip to content
This repository was archived by the owner on Feb 5, 2022. It is now read-only.

Commit cf7d81f

Browse files
Sam HSam H
authored andcommitted
ci: add scripts to auto convert images to webp on prepublish
1 parent 73aebde commit cf7d81f

10 files changed

+4
-1
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
"cypress": "cypress open",
1919
"version": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
2020
"st:generate": "node scripts/st-generate.js",
21-
"prepublish": "stencil build --prod",
21+
"jpg-webp": "for file in src/assets/*.jpg; do cwebp -q 75 \"$file\" -o \"${file%.jpg}.webp\"; done",
22+
"png-webp": "for file in src/assets/*.png; do cwebp -q 75 \"$file\" -o \"${file%.png}.webp\"; done",
23+
"jpeg-webp": "for file in src/assets/*.jpeg; do cwebp -q 75 \"$file\" -o \"${file%.jpeg}.webp\"; done",
24+
"prepublish": "npm run jpg-webp && npm run png-webp && npm run jpeg-webp && stencil build --prod",
2225
"firebase:deploy": "node scripts/deploy.js",
2326
"firebase:deploy:dev": "firebase use default && firebase deploy --token \"$FIREBASE_TOKEN\"",
2427
"firebase:deploy:prod": "firebase use production && firebase deploy --token \"$FIREBASE_TOKEN\""
-1.35 MB
Loading
395 KB
Loading
219 KB
Loading
1.49 KB
Loading
24.7 KB
Loading
4.37 KB
Loading
18.9 KB
Loading
3.48 KB
Loading
37.6 KB
Loading

0 commit comments

Comments
 (0)