build.sh updates
This commit is contained in:
parent
47429958d4
commit
baf0875a08
13
build.sh
13
build.sh
@ -1,10 +1,18 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if test "$1" == "" || test "$1" == "release"; then
|
rm -fr tmp pkg | true #delete tmp folder if exists
|
||||||
wasm-pack build --target web --release --no-typescript
|
|
||||||
|
#apply optimizations via wasm-opt
|
||||||
|
wasm_opt() {
|
||||||
wasm-opt -Os -o pkg/integral_site_bg_2.wasm pkg/integral_site_bg.wasm
|
wasm-opt -Os -o pkg/integral_site_bg_2.wasm pkg/integral_site_bg.wasm
|
||||||
mv pkg/integral_site_bg_2.wasm pkg/integral_site_bg.wasm
|
mv pkg/integral_site_bg_2.wasm pkg/integral_site_bg.wasm
|
||||||
|
}
|
||||||
|
|
||||||
|
if test "$1" == "" || test "$1" == "release"; then
|
||||||
|
wasm-pack build --target web --release --no-typescript
|
||||||
|
wasm_opt #apply wasm optimizations
|
||||||
|
|
||||||
llvm-strip --strip-all pkg/integral_site_bg.wasm
|
llvm-strip --strip-all pkg/integral_site_bg.wasm
|
||||||
elif test "$1" == "debug"; then
|
elif test "$1" == "debug"; then
|
||||||
wasm-pack build --target web --debug --no-typescript
|
wasm-pack build --target web --debug --no-typescript
|
||||||
@ -13,7 +21,6 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -fr tmp | true #delete tmp folder if exists
|
|
||||||
mkdir tmp tmp/pkg
|
mkdir tmp tmp/pkg
|
||||||
cp -r pkg/integral_site_bg.wasm pkg/integral_site.js tmp/
|
cp -r pkg/integral_site_bg.wasm pkg/integral_site.js tmp/
|
||||||
cp www/index.html www/style.css tmp/
|
cp www/index.html www/style.css tmp/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user