Skip to content

Commit

Permalink
Ensure piet-web example build script works on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
rylev committed Jan 7, 2019
1 parent cb1d234 commit cecc179
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion piet-web/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ crate-type = ["cdylib", "rlib"]
kurbo = "0.1.2"
piet = { path = "../piet" }

wasm-bindgen = "0.2.29"
wasm-bindgen = "0.2.30"

[dependencies.web-sys]
version = "0.3.6"
Expand Down
5 changes: 4 additions & 1 deletion piet-web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

Ensure both cargo and [npm] are installed.

`$ cargo install -f wasm-bindgen`
Make sure that wasm-bindgen is installed. This needs to be the same version of
wasm-bindgen used by piet-web.

`$ cargo install -f wasm-bindgen-cli`

`$ cd examples/basic && ./build.sh`

Expand Down
2 changes: 1 addition & 1 deletion piet-web/examples/basic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ crate-type = ["cdylib"]
[dependencies]
piet = { path = "../../../piet" }
piet-web = { path = "../.." }
wasm-bindgen = "0.2.29"
wasm-bindgen = "0.2.30"
kurbo = "0.1.2"

[dependencies.web-sys]
Expand Down
7 changes: 4 additions & 3 deletions piet-web/examples/basic/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -ex

# Build the `hello_world.wasm` file using Cargo/rustc
# Build the `hello_world.wasm` file using Cargo
cargo build --target wasm32-unknown-unknown

# Run the `wasm-bindgen` CLI tool to postprocess the wasm file emitted by the
Expand All @@ -11,5 +11,6 @@ wasm-bindgen ../../../target/wasm32-unknown-unknown/debug/piet_web_example.wasm

# Finally, package everything up using Webpack and start a server so we can
# browse the result
npm install --prefix basic-web-static
npm run serve --prefix basic-web-static
cd basic-web-static
npm install
npm run serve

0 comments on commit cecc179

Please sign in to comment.