mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-04-27 10:39:25 -04:00
crypto-js: support npm run build:dev (#1510)
Building the crypto-js bindings in release mode is very slow and not really necessary for local development. `--release` is the default, so there is no need to specify it explicitly. Instead, allow `wasm-pack` args to be specified by an env var, and add a `build:debug` npm script which will build in debug mode.
This commit is contained in:
committed by
GitHub
parent
480800b996
commit
a0807cb337
@@ -40,7 +40,8 @@
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "prettier --check .",
|
||||
"build": "./scripts/build.sh",
|
||||
"build": "WASM_PACK_ARGS=--release ./scripts/build.sh",
|
||||
"build:dev": "WASM_PACK_ARGS=--dev ./scripts/build.sh",
|
||||
"test": "jest --verbose",
|
||||
"doc": "typedoc --tsconfig .",
|
||||
"prepack": "npm run build && npm run test"
|
||||
|
||||
@@ -16,7 +16,7 @@ set -e
|
||||
|
||||
cd $(dirname "$0")/..
|
||||
|
||||
RUSTFLAGS='-C opt-level=z' WASM_BINDGEN_WEAKREF=1 wasm-pack build --release --target nodejs --scope matrix-org --out-dir pkg
|
||||
RUSTFLAGS='-C opt-level=z' WASM_BINDGEN_WEAKREF=1 wasm-pack build --target nodejs --scope matrix-org --out-dir pkg "${WASM_PACK_ARGS[@]}"
|
||||
|
||||
# Convert the Wasm into a JS file that exports the base64'ed Wasm.
|
||||
echo "module.exports = \`$(base64 pkg/matrix_sdk_crypto_js_bg.wasm)\`;" > pkg/matrix_sdk_crypto_js_bg.wasm.js
|
||||
|
||||
Reference in New Issue
Block a user