samhuri.net/bin/minify-js.sh

16 lines
245 B
Bash
Executable file

#!/bin/sh
DIR=$(dirname "$0")
UGLIFY="$DIR/../node_modules/.bin/uglifyjs"
function minify() {
INPUT="$1"
"$UGLIFY" --compress --screw-ie8 "$INPUT"
}
if [[ "$1" != "" ]]; then
minify "$1"
else
echo "usage: $0 [input file]"
exit 1
fi