diff options
Diffstat (limited to 'crates/gipfel-desktop/build-frontend.sh')
| -rwxr-xr-x | crates/gipfel-desktop/build-frontend.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/gipfel-desktop/build-frontend.sh b/crates/gipfel-desktop/build-frontend.sh new file mode 100755 index 0000000..72a1687 --- /dev/null +++ b/crates/gipfel-desktop/build-frontend.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# Build the gipfel WASM front end into dist/ for tauri to bundle. +# Runs from crates/gipfel-desktop (tauri beforeBuildCommand). +set -e +HERE="$(cd "$(dirname "$0")" && pwd)" +DIST="$HERE/dist" +mkdir -p "$DIST" +cd "$HERE/../.." +cargo build -p gipfel --target wasm32-unknown-unknown --release +wasm-bindgen --target web --out-dir "$DIST" \ + target/wasm32-unknown-unknown/release/gipfel.wasm +cp crates/gipfel/www/index.html crates/gipfel/www/style.css \ + crates/gipfel/www/loader.js "$DIST/" +gzip -9 -n -c gipfel.dat > "$DIST/gipfel.dat.gz" +echo "frontend dist ready: $DIST" |
