From 7e4e119b53272ffcd0b34ef6830ef739b6784f9c Mon Sep 17 00:00:00 2001 From: arcadeperfect Date: Tue, 26 Nov 2024 22:00:40 -0500 Subject: [PATCH] post process build script --- build_wasm.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build_wasm.sh b/build_wasm.sh index 9b358cb..ab8caf7 100755 --- a/build_wasm.sh +++ b/build_wasm.sh @@ -2,3 +2,6 @@ set -e cargo build --release --target wasm32-unknown-unknown wasm-bindgen --out-dir ./out/ --target web ./target/wasm32-unknown-unknown/release/bevy_vaporwave.wasm + +sed -i 's/getObject(arg0).focus();/const scrollPos = window.scrollY; getObject(arg0).focus(); window.scrollTo(0, scrollPos);/' ./out/bevy_vaporwave.js +