Skip to content

Commit

Permalink
Merge #61
Browse files Browse the repository at this point in the history
61: Instructions for the stdweb backend in the hello example. r=grovesNL a=theypsilon

Previously there weren't instructions to run the 'hello' example on stdweb, so I'm adding them.

But I also noticed that the README.md is not quite right yet. The web-sys backend instructions seem obsolete, but I can't find and easy way to make it work with wasm-pack because 'hello' is a binary crate.

Here is a pull request to make wasm-pack compatible with binary crates: rustwasm/wasm-pack#736

Co-authored-by: José manuel Barroso Galindo <theypsilon@gmail.com>
  • Loading branch information
bors[bot] and theypsilon authored Nov 22, 2019
2 parents adc6359 + c0e5d2d commit 6541246
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/hello/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,17 @@ cargo run --features=window-sdl2

`cd` to `examples/hello` directory

To run with web-sys:

```shell
cargo +nightly build --target wasm32-unknown-unknown
mkdir -p generated
wasm-bindgen ../../target/wasm32-unknown-unknown/debug/hello.wasm --out-dir generated --no-modules
cp index.html generated
```

To run with stdweb:

```shell
cargo web start --no-default-features --features stdweb --target wasm32-unknown-unknown
```

0 comments on commit 6541246

Please sign in to comment.