yewprint/build.sh

30 lines
573 B
Bash
Raw Normal View History

2020-09-03 16:45:38 +02:00
#!/bin/bash
if [ ${#@} == 0 ]; then
options=(--release)
else
options=()
fi
2020-09-03 17:14:16 +02: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 13:00:10 +02:00
# cleanup
2020-09-21 14:09:31 +02:00
mkdir -p public
rm -fR public/.gitignore public/*
# copy index.html
cp static/index.html public/
# download blueprint css
tar xzOf core.tgz package/lib/css/blueprint.css > public/blueprint.css
2020-09-20 14:59:47 -03:00
2020-09-21 13:00:10 +02:00
# build
2020-09-21 14:09:31 +02:00
wasm-pack build --no-typescript --target web --out-name wasm --out-dir ./public "${options[@]}" "$@"
2020-09-03 16:45:38 +02:00
rc=$?
2020-09-20 14:59:47 -03:00
2020-09-21 14:09:31 +02:00
rm -fR public/{.gitignore,package.json,README.md}
2020-09-03 16:45:38 +02:00
exit $rc