mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2025-01-06 04:07:47 +03:00
parent
a1520c4e5d
commit
7993d911f2
@ -3,12 +3,13 @@
|
||||
set -ex
|
||||
|
||||
# Compile our wasm module and run `wasm-bindgen`
|
||||
wasm-pack build --target web
|
||||
wasm-pack build
|
||||
|
||||
# Run the `wasm2js` tool from `binaryen`
|
||||
wasm2js pkg/wasm2js_bg.wasm -o pkg/wasm2js_bg.js
|
||||
wasm2js pkg/wasm2js_bg.wasm -o pkg/wasm2js_bg.wasm.js
|
||||
|
||||
# Update our JS shim to require the JS file instead
|
||||
sed -i 's/wasm2js_bg.wasm/wasm2js_bg.js/' pkg/wasm2js.js
|
||||
sed -i 's/wasm2js_bg.wasm/wasm2js_bg.wasm.js/' pkg/wasm2js.js
|
||||
sed -i 's/wasm2js_bg.wasm/wasm2js_bg.wasm.js/' pkg/wasm2js_bg.js
|
||||
|
||||
http
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Import our JS shim and initialize it, executing the start function when it's
|
||||
// ready.
|
||||
import init from './pkg/wasm2js.js';
|
||||
init();
|
||||
// Import our JS shim; will initialize by itself
|
||||
import { run } from './pkg/wasm2js.js';
|
||||
// Run the function a second time
|
||||
run();
|
||||
|
Loading…
Reference in New Issue
Block a user