Merge pull request #72 from rust-windowing/run-wasm

Add `run-wasm` workspace member, as used in `winit`
This commit is contained in:
Ian Douglas Scott 2023-02-23 10:58:57 -08:00 committed by GitHub
commit 1381217fe5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 0 deletions

2
.cargo/config.toml Normal file
View file

@ -0,0 +1,2 @@
[alias]
run-wasm = ["run", "--release", "--package", "run-wasm", "--"]

View file

@ -72,3 +72,8 @@ features = ["jpeg"]
# Turn rayon back on everywhere else; creating the separate entry resets the features to default. # Turn rayon back on everywhere else; creating the separate entry resets the features to default.
image = "0.23.14" image = "0.23.14"
rayon = "1.5.1" rayon = "1.5.1"
[workspace]
members = [
"run-wasm",
]

View file

@ -50,6 +50,11 @@ For now, the priority for new platforms is:
- Xcb ❌ - Xcb ❌
- Xlib ✅ - Xlib ✅
WebAssembly
-----------
To run an example with the web backend: `cargo run-wasm --example winit`
Example Example
== ==
```rust,no_run ```rust,no_run

7
run-wasm/Cargo.toml Normal file
View file

@ -0,0 +1,7 @@
[package]
name = "run-wasm"
version = "0.1.0"
edition = "2021"
[dependencies]
cargo-run-wasm = "0.3.0"

3
run-wasm/src/main.rs Normal file
View file

@ -0,0 +1,3 @@
fn main() {
cargo_run_wasm::run_wasm_with_css("body { margin: 0px; }");
}