opt-cc/minify.sh

16 lines
553 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
2017-09-03 15:24:27 +02:00
FILES=(inline.bundle main.bundle polyfills.bundle scripts.bundle styles.bundle vendor.bundle admin.module.chunk common.chunk decoration.module.chunk ranks.module.chunk request.module.chunk squads.module.chunk stats.module.chunk users.module.chunk)
2017-07-29 11:46:01 +02:00
OPTIONS="-c toplevel,dead_code=true,unused=true"
for i in "${FILES[@]}"
do
echo "minify ${i} ..."
2017-09-03 12:49:59 +02:00
$(npm bin)/uglifyjs public/${i}.js ${OPTIONS} -o public/${i}.js
rm -f public/${i}.js.map
2017-07-29 11:46:01 +02:00
done