Skip to content

Commit bb2e7ba

Browse files
committed
Use wasm-server-runner instead of cargo-run-wasm
This integrates much more cleanly with Cargo, and allows people to use the guidance in their own projects without further setup.
1 parent 72bc417 commit bb2e7ba

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

.cargo/config.toml

Lines changed: 0 additions & 2 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
Cargo.lock
33
/.idea
44
/.vscode
5+
6+
# Allow people to customize this for their own checkouts.
7+
.cargo

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[workspace]
2-
members = ["run-wasm"]
3-
41
[package]
52
name = "softbuffer"
63
version = "0.4.8"

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,20 @@ Pull requests to add support for new platforms are welcome!
6666

6767
## WebAssembly
6868

69-
To run an example with the web backend: `cargo run-wasm --example winit`
69+
To run an example with the web backend, add the following to `.cargo/config.toml`:
70+
```toml
71+
[target.'cfg(target_family = "wasm")']
72+
runner = "wasm-server-runner"
73+
```
74+
75+
And then run:
76+
77+
```sh
78+
cargo install wasm-server-runner
79+
cargo run --target wasm32-unknown-unknown --example winit
80+
```
81+
82+
And open the link to view the result in the browser.
7083

7184
## Android
7285

run-wasm/Cargo.toml

Lines changed: 0 additions & 7 deletions
This file was deleted.

run-wasm/src/main.rs

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)