cargo install wasm-pack
Try --no-default-features
option if you have OpenSSL issues.
Run the below, which compiles src/rust
and builds a WASM package lib/wasm-sample
.
npm run build:wasm
Then run the below to deploy the WASM package into node_modules
so that you can import it in src/js
.
npm install
It also installs other devDependencies necessary for subsequent steps.
To run src/js
on Node.js environment:
npm run start:node
To bundle src/js
and deploy an web app into public
:
npm run build:js:web
To run the bundled web app on public/index.html
:
npm run start:web
then open the localhost.