feat: Add webp convertion

This commit is contained in:
2021-05-12 08:42:53 +02:00
parent 22e23b0162
commit 08c42b16fa
3 changed files with 211 additions and 542 deletions

View File

@ -84,7 +84,7 @@ optimizer() {
echo "🖼️ Optimisation des images"
echo
# $SCRIPT_DIR/../node_modules/.bin/imagemin $PWD/static -o $PWD/static
find ./static ./content -type f | xargs -I % bash -c '$0/../node_modules/.bin/imagemin % -o $(dirname %)' $SCRIPT_DIR
find ./static ./content -type f \( -iname \*.jpg \) | xargs -I % bash -c '$0/../node_modules/.bin/imagemin % --plugin.webp.quality=95 > $(dirname %)/$(basename % | sed "s/\(.*\)\..*/\1/").webp' $SCRIPT_DIR
}
optimizer_git_image() {