From 7286f81091e12397396af3ba166c308381db72c5 Mon Sep 17 00:00:00 2001 From: Brian Carroll Date: Wed, 16 Feb 2022 20:40:19 +0000 Subject: [PATCH] repl_www: faster build script, without wasm-opt --- repl_www/build.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/repl_www/build.sh b/repl_www/build.sh index 549dbfaf1c..bf1d944864 100755 --- a/repl_www/build.sh +++ b/repl_www/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -eux +set -ex if [[ ! -d repl_www ]] then @@ -17,12 +17,15 @@ WWW_DIR="repl_www/build" mkdir -p $WWW_DIR cp repl_www/public/* $WWW_DIR -# Pass all script arguments through to wasm-pack # For debugging, pass the --profiling option, which enables optimizations + debug info # (We need optimizations to get rid of dead code that otherwise causes compile errors!) -cargo build --target wasm32-unknown-unknown -p roc_repl_wasm --release -wasm-bindgen --target web --keep-debug target/wasm32-unknown-unknown/release/roc_repl_wasm.wasm --out-dir repl_wasm/pkg/ -# wasm-pack build --target web "$@" repl_wasm +if [ -n "$REPL_DEBUG" ] +then + cargo build --target wasm32-unknown-unknown -p roc_repl_wasm --release + wasm-bindgen --target web --keep-debug target/wasm32-unknown-unknown/release/roc_repl_wasm.wasm --out-dir repl_wasm/pkg/ +else + wasm-pack build --target web repl_wasm +fi cp repl_wasm/pkg/*.wasm $WWW_DIR