An open API service indexing awesome lists of open source software.

https://github.com/zuramai/vite-wasm-starter

Vite + Webassembly starter project
https://github.com/zuramai/vite-wasm-starter

boilerplate rust typescript wasm wasm-example

Last synced: about 1 month ago
JSON representation

Vite + Webassembly starter project

Awesome Lists containing this project

README

        





Vite + Typescript+ Webassembly


A starter project for you to create a blazingly fast web application

## Before getting started

You need to get these prerequisites installed:

* [Rust](https://www.rust-lang.org/learn/get-started)
* [NodeJS](https://nodejs.org)
* [wasm-pack](https://github.com/rustwasm/wasm-pack)
* [rsw-rs](https://github.com/lencx/rsw-rs)

## Installation

#### 1. Clone the repository
```sh
git clone https://github.com/zuramai/vite-wasm-starter
cd vite-wasm-starter
```

#### 2. Install dependencies
```sh
pnpm install # OR npm install
```

#### 3. Run the application

You should open two tabs of terminal. **The order of execution is important and do not close the first window ⚠️**.

In the first tab, run:
```
pnpm rsw watch
```

In the second tab, run:
```sh
pnpm dev
```

## Deploying

Run:
```sh
pnpm run build
```

## Adding a crate

1. Generate rust crate
```sh
pnpm rsw new hello-world
```

This will create a crate in a folder named `hello-world`

2. Edit `rsw.toml` to register the crate
```sh
[[crates]]
name = "hello-world"
```