minifycssjs.sh 486 Bytes
Newer Older
Davide Depau's avatar
Davide Depau committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/bin/bash

sitedir="$1"

echo "Minifying JavaScript"
find "$sitedir" -type f \
    -name "*.js" ! -name "*.min.*" ! -name "vfs_fonts*" \
    -exec echo {} \; \
    -exec ./node_modules/.bin/uglifyjs -o {}.min {} \; \
    -exec rm {} \; \
    -exec mv {}.min {} \;

echo "Minifying CSS"
find "$sitedir" -type f \
    -name "*.css" ! -name "*.min.*" \
    -exec echo {} \; \
    -exec ./node_modules/.bin/uglifycss --output {}.min {} \; \
    -exec rm {} \; \
    -exec mv {}.min {} \;