-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
45 lines (38 loc) · 1.62 KB
/
Makefile
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
42
43
44
45
default: build
compile:
haxe build.hxml
cp temp/main.js temp/original.js
sed '1d' -i temp/main.js
sed '1d' -i temp/main.js
sed '1d' -i temp/main.js
sed '1d' -i temp/main.js
for i in {1..14}; do sed '$$d' -i temp/main.js; done
build: compile
mkdir -p build
cat src/before_dev.html > build/index.html
cat temp/main.js >> build/index.html
cat src/after_dev.html >> build/index.html
minify:
terser --compress unsafe_arrows=true,unsafe=true,toplevel=true,passes=8 --mangle --mangle-props --toplevel --ecma 6 -O ascii_only=true -- temp/main.js > temp/main.min.js
regpack temp/main.min.js > temp/main.min.regpack.js
stat temp/main.min.regpack.js | grep Size
retail: compile
mkdir -p build
cat src/before.html > build/index.html
cat temp/main.js >> build/index.html
cat src/after.html >> build/index.html
rm -rf retail
mkdir -p retail
terser --compress unsafe_arrows=true,unsafe=true,toplevel=true,passes=8 --mangle --mangle-props --toplevel --ecma 6 -O ascii_only=true -- temp/main.js > temp/main.min.js
# terser --compress toplevel=true,passes=2 --ecma 6 -O ascii_only=true -- temp/main.js > temp/main.min.js
# terser --compress toplevel=true,passes=2 --ecma 6 -O ascii_only=true -- temp/main.js > temp/main.min.js
# cp temp/main.js temp/main.min.js
# regpack temp/main.min.js > temp/main.min.regpack.js
# cat src/before.html temp/main.min.regpack.js src/after.html | tr -d '\n' > retail/index.html
cat src/before_dev.html temp/main.min.js src/after_dev.html > retail/index.html
stat retail/index.html | grep Size
zip: retail
rm -f retail.zip
cd retail && zip ../retail.zip -r .
stat retail.zip | grep Size
.PHONY: build retail