Skip to content

Commit

Permalink
build script uses release options
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkirk committed Jul 16, 2024
1 parent 668afe7 commit 7c5a309
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build WebAssembly project
run: wasm-pack build --target web
run: bin/build-wasm.sh
working-directory: geomedea-wasm

- name: Copy web assets
Expand Down
9 changes: 0 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,3 @@ members = [
# waiting for release
geozero = { git = "https://github.com/georust/geozero", rev = "8501fedf288adc851d08a367f8f651ee643d4bed" }

[profile.release]
# with nothing: 689k # 688680
lto = true # 688563
opt-level = 'z' # 627672
# + wee_alloc # 621205
# w/o console_logging
# and console_error_panic_hook: # 614374
# w/o log # 612566
# After cleanups (adding #cfg) # 610765
3 changes: 0 additions & 3 deletions geomedea-wasm/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/target
**/*.rs.bk
Cargo.lock
bin/
pkg/
wasm-pack.log
11 changes: 11 additions & 0 deletions geomedea-wasm/bin/build-wasm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
set -ex

REPO_ROOT=$(git rev-parse --show-toplevel)
cd "$REPO_ROOT/geomedea-wasm"

wasm-pack build --target web --release . \
--config 'profile.release.opt-level="z"' \
--config 'profile.release.lto=true'

ls -l pkg/geomedea_wasm_bg.wasm

0 comments on commit 7c5a309

Please sign in to comment.