In order to build the three-d
examples for the web, you can follow these steps. All commands should run in this web/
directory.
-
Make sure you have both
Rust
andnpm
(which should includenpx
) installed. -
Run
$ npm install
- Run (The following command builds the
triangle
example. Replace the path to the example to build other examples. You can find an overview of all examples inexamples/README.md
.)
$ npx wasm-pack build "../examples/triangle" --target web --out-name web --out-dir ../../web/pkg
- Run
$ npm run serve
- Open
http://localhost:8080
in a browser