forked from r-paydaybuilds/pd2builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
predeploy.sh
41 lines (37 loc) · 803 Bytes
/
predeploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
echo "Minifying HTML..."
cd pages
#minify html
for file in ./*; do
npx html-minifier --collapse-whitespace --remove-comments --remove-redundant-attributes --remove-script-type-attributes $file -o a
mv a $file
done
mv ./* ../public/ #move all pages
echo "done"
echo "Minifying JS..."
cd ../public/js
#minify js
for file in ./*.js; do
npx terser -m module=true -c ecma=8,module=true -- $file > a
mv a $file
done
echo "done"
echo "Minifying JSON"
cd ../db
for file in ./*.json; do
npm run json -- "./public/db/$file"
done
cd ../lang
for file in ./*.json; do
npm run json -- "./public/lang/$file"
done
echo "done"
#echo "Minifying CSS"
#cd ../css
#minify css
#for file in ./*.css; do
# npx postcss $file > a
# mv a $file
#done
#echo "done"
mv ../../LICENSE ../