mirror of
https://github.com/inttter/md-badges.git
synced 2026-05-06 18:36:58 +02:00
✨ docs: add instructions for building with wasm-pack in README.md
This commit is contained in:
parent
6bc017da35
commit
1295ff2fc0
1 changed files with 33 additions and 0 deletions
|
|
@ -18,3 +18,36 @@ Clone the repository and start exploring different markdown badge implementation
|
||||||
git clone https://github.com/inttter/md-badges.git
|
git clone https://github.com/inttter/md-badges.git
|
||||||
cd md-badges/playground
|
cd md-badges/playground
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Building with `wasm-pack`
|
||||||
|
|
||||||
|
To build the Rust code for WebAssembly and integrate it with the web frontend, follow these steps:
|
||||||
|
|
||||||
|
1. **Install `wasm-pack`** (if you haven't already):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cargo install wasm-pack
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Build the Rust project for the web target**:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd rust
|
||||||
|
cargo install
|
||||||
|
wasm-pack build --target web --out-dir ../web/pkg
|
||||||
|
```
|
||||||
|
|
||||||
|
This command compiles the Rust code to WebAssembly and outputs the generated files to the `../web/pkg` directory.
|
||||||
|
|
||||||
|
3. **Start the web frontend** (if applicable):
|
||||||
|
|
||||||
|
Navigate to the `web` directory and start your frontend development server as needed.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ../web
|
||||||
|
# For example, if using npm:
|
||||||
|
npm install
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
Now you can experiment with the playground using the latest Rust-to-WebAssembly integration.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue