Add run-wasm workspace member, as used in winit
This makes it easy to run examples with the web backend, in the same way that winit examples are run.
This commit is contained in:
parent
83c0f92dc5
commit
3b9976685c
5 changed files with 22 additions and 0 deletions
2
.cargo/config.toml
Normal file
2
.cargo/config.toml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
[alias]
|
||||||
|
run-wasm = ["run", "--release", "--package", "run-wasm", "--"]
|
||||||
|
|
@ -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",
|
||||||
|
]
|
||||||
|
|
|
||||||
|
|
@ -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
7
run-wasm/Cargo.toml
Normal 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
3
run-wasm/src/main.rs
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
fn main() {
|
||||||
|
cargo_run_wasm::run_wasm_with_css("body { margin: 0px; }");
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue