Skip to content

Commit

Permalink
Added instructions on building for wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
ecton committed Aug 30, 2023
1 parent 81dcf63 commit 2faa189
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,26 @@ directory in the repository.
`gooey_core::graphics::Renderer`. This allows rasterized applications to be
built using [Kludgine][kludgine], which is powered by `wgpu` and `winit`.

## Building and Running examples on WASM

1. Compile the example:

```sh
cargo build --example counter --target wasm32-unknown-unknown --no-default-features --features web
```

2. Generate the wasm bindings:

```sh
wasm-bindgen target/wasm32-unknown-unknown/debug/examples/counter.wasm crates/gooey/examples/browser/pkg/
```

3. Run a webserver hosting the page (opening a .html won't allow loading wasm files):

```sh
miniserve examples/browser/
```

## Open-source Licenses

This project, like all projects from [Khonsu Labs](https://khonsulabs.com/), are
Expand Down

0 comments on commit 2faa189

Please sign in to comment.