]> git.mxchange.org Git - friendica.git/blob - bin/dev/minifyjs.sh
Unneeded stuff removed, only fetch needed records
[friendica.git] / bin / dev / minifyjs.sh
1 #!/bin/bash
2
3 command -v uglifyjs >/dev/null 2>&1 || { echo >&2 "I require UglifyJS but it's not installed.  Aborting."; exit 1; }
4
5 MINIFY_CMD=uglifyjs
6
7 JSFILES=(
8         "view/js/acl.js"
9         "view/js/ajaxupload.js"
10         "view/js/country.js"
11         "view/js/main.js"
12         "vendor/asset/base64/base64.min.js"
13         "view/theme/frost/js/acl.js"
14         "view/theme/frost/js/jquery.divgrow-1.3.1.f1.js"
15         "view/theme/frost/js/main.js"
16         "view/theme/frost/js/theme.js"
17         "view/theme/frost-mobile/js/acl.js"
18         "view/theme/frost-mobile/js/jquery.divgrow-1.3.1.f1.js"
19         "view/theme/frost-mobile/js/main.js"
20         "view/theme/frost-mobile/js/theme.js"
21         "view/theme/decaf-mobile/js/theme.js"
22 )
23 JSFILES2=(
24         "library/colorbox/jquery.colorbox.js"
25 )
26
27 for i in ${JSFILES[@]}
28 do
29         MINFILE=${i%%.js}.min.js
30         echo "Minifying $i into $MINFILE"
31         rm $MINFILE
32         $MINIFY_CMD -o $MINFILE $i
33 done
34
35 for i in ${JSFILES2[@]}
36 do
37         MINFILE=${i%%.js}-min.js
38         echo "Minifying $i into $MINFILE"
39         rm $MINFILE
40         $MINIFY_CMD -o $MINFILE $i
41 done
42
43 for i in ${JSFILES3[@]}
44 do
45         MINFILE=${i%%_src.js}.js
46         echo "Minifying $i into $MINFILE"
47         rm $MINFILE
48         $MINIFY_CMD -o $MINFILE $i
49 done
50