Open
Description
Suggested instructions that don't need a generator or a bundler:
- make sure
wasm-pack
is installed - checkout or download https://github.com/rustwasm/wasm-bindgen
- got to
examples/hello_world/
- execute
wasm-pack build --target web
- create an
index.html
like
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
</head>
<body>
<script type="module">
import init, { greet } from './pkg/hello_world.js';
async function run() {
await init();
greet("World");
}
run();
</script>
</body>
</html>
- open
index.html
in a browser