Skip to content

Commit 1381217

Browse files
authored
Merge pull request #72 from rust-windowing/run-wasm
Add `run-wasm` workspace member, as used in `winit`
2 parents 83c0f92 + 3b99766 commit 1381217

File tree

5 files changed

+22
-0
lines changed

5 files changed

+22
-0
lines changed

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[alias]
2+
run-wasm = ["run", "--release", "--package", "run-wasm", "--"]

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,8 @@ features = ["jpeg"]
7272
# Turn rayon back on everywhere else; creating the separate entry resets the features to default.
7373
image = "0.23.14"
7474
rayon = "1.5.1"
75+
76+
[workspace]
77+
members = [
78+
"run-wasm",
79+
]

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ For now, the priority for new platforms is:
5050
- Xcb ❌
5151
- Xlib ✅
5252

53+
WebAssembly
54+
-----------
55+
56+
To run an example with the web backend: `cargo run-wasm --example winit`
57+
5358
Example
5459
==
5560
```rust,no_run

run-wasm/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[package]
2+
name = "run-wasm"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
cargo-run-wasm = "0.3.0"

run-wasm/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
cargo_run_wasm::run_wasm_with_css("body { margin: 0px; }");
3+
}

0 commit comments

Comments
 (0)