2017-06-13 11:02:38 +02:00
|
|
|
# Remove previous build to avoid name conflicts
|
|
|
|
rm -rf target/wasm32-unknown-emscripten/*
|
|
|
|
|
|
|
|
# Build using nightly rustc + emscripten
|
|
|
|
rustup run nightly cargo build --release --target=wasm32-unknown-emscripten
|
|
|
|
|
|
|
|
# Copy final WASM file over
|
|
|
|
cp ./target/wasm32-unknown-emscripten/release/deps/parity_ethkey_wasm-*.wasm ./ethkey.wasm
|
|
|
|
|
|
|
|
# Create a Base64-encoded JS version of the wasm file for easy inclusion in Webpack
|
|
|
|
node base64ify
|
|
|
|
|
|
|
|
# Copy Base64-encoded JS version to src
|
2017-07-21 15:46:53 +02:00
|
|
|
cp ./ethkey.wasm.js ../../packages/api/local/ethkey/ethkey.wasm.js
|
2017-06-13 11:02:38 +02:00
|
|
|
|
|
|
|
# rm -f ./ethkey.wasm ./ethkey.opt.wasm ./ethkey.wasm.js
|