forked from M5M400/supportxmr-gui
-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.sh
executable file
·23 lines (20 loc) · 1.04 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash -x
# sudo DEBIAN_FRONTEND=noninteractive apt-get install -y chromium-browser
# npm install -g uglifycss uglify-js html-minifier
# npm install -D critical@latest
# snap install chromium
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd $SCRIPT_DIR
export PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
mkdir `pwd`/tmp 2>/dev/null
uglifycss --output build/style_min.css style.css &&\
#uglifyjs --output build/script_min.js script.js web_miner/miner.js &&\
#uglifyjs --output build/worker.js web_miner/worker.js &&\
uglifyjs --output build/script_min.js script.js &&\
#cp web_miner/cn.min.js build/cn.min.js &&\
html-minifier --output build/index-raw.html index.html --collapse-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --remove-tag-whitespace --use-short-doctype --minify-css true --minify-js true &&\
TMP=`pwd`/tmp node critical.mjs &&\
rm build/index-raw.html &&\
sudo rm -rf /var/www/mo &&\
sudo cp -r build /var/www/mo &&\
echo OK