From ce03f016b901bdee8bbb9c4a0b9f3c8a71a8f346 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 1 Nov 2022 10:19:13 +0000 Subject: [PATCH] Copy unbase64.js into the right place --- bindings/matrix-sdk-crypto-js/scripts/build.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bindings/matrix-sdk-crypto-js/scripts/build.sh b/bindings/matrix-sdk-crypto-js/scripts/build.sh index fc6c57a08..835b0ad8d 100755 --- a/bindings/matrix-sdk-crypto-js/scripts/build.sh +++ b/bindings/matrix-sdk-crypto-js/scripts/build.sh @@ -23,10 +23,13 @@ RUSTFLAGS='-C opt-level=z' WASM_BINDGEN_WEAKREF=1 wasm-pack build --release --ta echo '`;' } > pkg/matrix_sdk_crypto_js_bg.wasm.js +# copy in the unbase64 module +cp unbase64.js pkg/ + # In the javascript: # 1. replace the lines that load the wasm # 2. remove the imports of TextDecoder and TextEncoder. We rely on the global defaults. -loadwasm='const bytes = require("../unbase64.js")(require("./matrix_sdk_crypto_js_bg.wasm.js"));' +loadwasm='const bytes = require("./unbase64.js")(require("./matrix_sdk_crypto_js_bg.wasm.js"));' sed -i -e "/^const path = /,+1 c$loadwasm" \ -e '/= require(`util`)/d' \ pkg/matrix_sdk_crypto_js.js