File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,9 +5,11 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
55REPO_ROOT=" $( cd " $SCRIPT_DIR /.." && pwd) "
66
77SKIP_BINARY=false
8+ SKIP_OPT=false
89for arg in " $@ " ; do
910 case " $arg " in
1011 --skip-binary) SKIP_BINARY=true ;;
12+ --skip-opt) SKIP_OPT=true ;;
1113 * ) echo " Unknown argument: $arg " >&2 ; exit 1 ;;
1214 esac
1315done
@@ -32,8 +34,12 @@ if [ "$SKIP_BINARY" = false ]; then
3234 echo " Building WASM binary..."
3335 (cd " $SCRIPT_DIR " && wasm-pack build --target web --profile wasm --no-opt)
3436
35- echo " Optimising WASM binary..."
36- (cd " $SCRIPT_DIR " && wasm-opt pkg/ggsql_wasm_bg.wasm -o pkg/ggsql_wasm_bg.wasm -Oz --all-features)
37+ if [ " $SKIP_OPT " = false ]; then
38+ echo " Optimising WASM binary..."
39+ (cd " $SCRIPT_DIR " && wasm-opt pkg/ggsql_wasm_bg.wasm -o pkg/ggsql_wasm_bg.wasm -Oz --all-features)
40+ else
41+ echo " Skipping wasm-opt (--skip-opt)."
42+ fi
3743else
3844 echo " Skipping WASM binary build (--skip-binary)."
3945fi
You can’t perform that action at this time.
0 commit comments