aboutsummaryrefslogtreecommitdiffstats
path: root/minify-images.sh
blob: e9c804cdb5884491e56a72fb7db69735aaeb2d09 (plain) (blame)
1
2
3
4
5
6
7
8
9
#!/usr/bin/env sh

# Note: This script is needed due to this bug: https://github.com/imagemin/imagemin/issues/348
# once the above is fixed, we should simply be able to specify the input directory where all image files are to be processed recursively
FILES=`find . -name "*.jpg" -o -name "*.jpeg" -o -name "*.bmp" -o -name "*.png" -type f | GREP_OPTIONS= egrep -v "node_modules"`
for file in $FILES; do
  echo "Minifying file: $file"
  npx imagemin $file > $file
done