docs: add WASM library demo using Vite & React

This commit is contained in:
rzmk 2024-06-20 20:13:34 -04:00
parent bc05a9f46e
commit 93bc82bd36
27 changed files with 534 additions and 111 deletions

View file

@ -20,7 +20,7 @@ Or use `npm`, `pnpm`, or `yarn` instead of `bun`.
The following example is written in TypeScript:
```ts
import init, * as czv from "czv";
import init, * as czv from "czv-wasm";
// Must run `await init()` or `initSync()` first for web use
await init();
@ -48,7 +48,7 @@ cargo install wasm-pack
### Build WASM for web
```bash
wasm-pack build --release --target web --out-name czv
wasm-pack build --release --target web
```
**Note**: Currently you must modify the `pkg/package.json` by replacing the name from `czv-wasm` to `czv`.