opt-cc/minify.sh

16 lines
378 B
Bash
Raw Normal View History

2017-07-29 11:46:01 +02:00
#!/usr/bin/env bash
2017-08-05 23:19:23 +02:00
# execute script in its location folder
cd $(dirname $0)
2017-07-29 11:46:01 +02:00
# array of files to minify
FILES=(inline main polyfills scripts styles vendor)
OPTIONS="-c toplevel,dead_code=true,unused=true"
for i in "${FILES[@]}"
do
echo "minify ${i} ..."
$(npm bin)/uglifyjs public/${i}.bundle.js ${OPTIONS} -o public/${i}.bundle.js
2017-07-29 16:50:14 +02:00
rm -f public/${i}.bundle.js.map
2017-07-29 11:46:01 +02:00
done