wasm-pack -> justfile

This commit is contained in:
hypercube
2025-07-24 19:44:17 +01:00
parent f184e4aab2
commit 25a8e86fb8
3 changed files with 248 additions and 9 deletions
+16
View File
@@ -0,0 +1,16 @@
# https://just.systems
output := 'wasm'/'pkg'/'graphite_wasm_bg.wasm'
build profile='debug':
cargo build -p graphite-wasm --lib --target wasm32-unknown-unknown --color=always {{ if profile != "debug" { "--release" } else { "" } }}
mkdir -p pkg
wasm-bindgen \
{{ '..' / 'target' / 'wasm32-unknown-unknown' / if profile != "debug" { 'release' / 'graphite_wasm.wasm' } else { 'debug' / 'graphite_wasm.wasm' } }} \
--out-dir {{ 'wasm' / 'pkg' }} --typescript --target web {{ if profile == "debug" { "--debug" } else { "" } }}
{{ if profile != 'debug' { "wasm-opt " + output + " -o " + output + " -O" } else { "" } }}