2020-09-03 14:45:38 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ ${#@} == 0 ]; then
|
2020-09-21 13:40:49 +00:00
|
|
|
options=(--release -- --features dev)
|
2020-09-03 14:45:38 +00:00
|
|
|
else
|
|
|
|
options=()
|
|
|
|
fi
|
|
|
|
|
2020-09-03 15:14:16 +00:00
|
|
|
if ! [ -f core.tgz ]; then
|
|
|
|
curl -o core.tgz https://registry.npmjs.org/@blueprintjs/core/-/core-3.30.0.tgz
|
|
|
|
fi
|
|
|
|
|
2020-09-21 11:00:10 +00:00
|
|
|
# cleanup
|
2020-09-21 12:09:31 +00:00
|
|
|
mkdir -p public
|
|
|
|
rm -fR public/.gitignore public/*
|
|
|
|
|
|
|
|
# copy index.html
|
|
|
|
cp static/index.html public/
|
|
|
|
|
|
|
|
# download blueprint css
|
2020-09-21 13:06:54 +00:00
|
|
|
tar xzOf core.tgz package/lib/css/blueprint.css > public/blueprint.css
|
2020-09-20 17:59:47 +00:00
|
|
|
|
2020-09-21 11:00:10 +00:00
|
|
|
# build
|
2020-09-21 12:09:31 +00:00
|
|
|
wasm-pack build --no-typescript --target web --out-name wasm --out-dir ./public "${options[@]}" "$@"
|
2020-09-03 14:45:38 +00:00
|
|
|
rc=$?
|
2020-09-20 17:59:47 +00:00
|
|
|
|
2020-09-21 12:09:31 +00:00
|
|
|
rm -fR public/{.gitignore,package.json,README.md}
|
2020-09-03 14:45:38 +00:00
|
|
|
|
|
|
|
exit $rc
|