|
@ -4,14 +4,18 @@ set -eu |
|
|
# Pre-requisites: |
|
|
# Pre-requisites: |
|
|
rustup target add wasm32-unknown-unknown |
|
|
rustup target add wasm32-unknown-unknown |
|
|
if ! [[ $(wasm-bindgen --version) ]]; then |
|
|
if ! [[ $(wasm-bindgen --version) ]]; then |
|
|
cargo install wasm-bindgen-cli |
|
|
cargo install -f wasm-bindgen-cli |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
if ! [[ -f docs/webassembly.d.ts ]]; then |
|
|
|
|
|
curl https://raw.githubusercontent.com/01alchemist/webassembly-types/master/webassembly.d.ts > docs/webassembly.d.ts |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
BUILD=debug |
|
|
BUILD=debug |
|
|
# BUILD=release |
|
|
# BUILD=release |
|
|
|
|
|
|
|
|
# Clear output from old stuff: |
|
|
# Clear output from old stuff: |
|
|
rm -rf docs/*.d.ts |
|
|
# rm -rf docs/*.d.ts |
|
|
rm -rf docs/*.js |
|
|
rm -rf docs/*.js |
|
|
rm -rf docs/*.wasm |
|
|
rm -rf docs/*.wasm |
|
|
|
|
|
|
|
@ -28,8 +32,9 @@ function build_rust |
|
|
# --no-modules-global hoboho |
|
|
# --no-modules-global hoboho |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
echo "Compile typescript:" |
|
|
|
|
|
build_rust |
|
|
build_rust |
|
|
|
|
|
|
|
|
|
|
|
echo "Compile typescript:" |
|
|
tsc |
|
|
tsc |
|
|
|
|
|
|
|
|
# wait || exit $? |
|
|
# wait || exit $? |
|
|