summaryrefslogtreecommitdiffstats
path: root/examples/counter
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2023-09-09 23:24:54 +0200
committerLibravatar GitHub <noreply@github.com>2023-09-09 23:24:54 +0200
commita3489e4af960388e9f73988b88df361022a654a4 (patch)
treef5bb9754aa08c4e2f27a025cf570c2f40d369d2e /examples/counter
parente3aa8f71e6d27135ddc3bddf2a141fe42375b3f9 (diff)
parentfbc9ef74c406b2a58bb2a093262323e346faf485 (diff)
downloadiced-a3489e4af960388e9f73988b88df361022a654a4.tar.gz
iced-a3489e4af960388e9f73988b88df361022a654a4.tar.bz2
iced-a3489e4af960388e9f73988b88df361022a654a4.zip
Merge pull request #2076 from Nisatru/run-web
Get web examples running again
Diffstat (limited to 'examples/counter')
-rw-r--r--examples/counter/Cargo.toml4
-rw-r--r--examples/counter/README.md8
2 files changed, 12 insertions, 0 deletions
diff --git a/examples/counter/Cargo.toml b/examples/counter/Cargo.toml
index 1e9bba6b..22f86064 100644
--- a/examples/counter/Cargo.toml
+++ b/examples/counter/Cargo.toml
@@ -7,3 +7,7 @@ publish = false
[dependencies]
iced.workspace = true
+
+[target.'cfg(target_arch = "wasm32")'.dependencies]
+iced.workspace = true
+iced.features = ["webgl"]
diff --git a/examples/counter/README.md b/examples/counter/README.md
index 53243c24..18761bba 100644
--- a/examples/counter/README.md
+++ b/examples/counter/README.md
@@ -13,4 +13,12 @@ You can run it with `cargo run`:
cargo run --package counter
```
+The web version can be run with [`trunk`]:
+
+```
+cd examples/counter
+trunk serve
+```
+
[`main`]: src/main.rs
+[`trunk`]: https://trunkrs.dev/