vite-plugin-wasm-pack
Advanced tools
Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "vite-plugin-wasm-pack", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "wasm-pack for Vite", | ||
@@ -19,3 +19,4 @@ "main": "dist/index.js", | ||
"rust", | ||
"webassembly" | ||
"webassembly", | ||
"cargo" | ||
], | ||
@@ -22,0 +23,0 @@ "author": "nshen <nshen121@gmail.com>", |
@@ -5,7 +5,58 @@ # 🚚 vite-plugin-wasm-pack | ||
Vite plugin for [wasm-pack](https://github.com/rustwasm/wasm-pack) rust | ||
🚚 Vite plugin for rust [wasm-pack](https://github.com/rustwasm/wasm-pack), it's simple. | ||
## Install | ||
## Quick start | ||
Make sure [wasm-pack](https://github.com/rustwasm/wasm-pack) installed correctly. | ||
Clone this repo or download the [zip file](https://github.com/nshen/vite-plugin-wasm-pack/archive/refs/heads/main.zip), extract the example folder. | ||
``` | ||
example | ||
| | ||
|-- my-crate # rust project folder, there is a Cargo.toml in it | ||
|-- src # front end source code | ||
| |-- index.ts # entry point | ||
|-- index.html # html entry | ||
|-- vite.config.ts # vite config file | ||
|__ package.json # npm config file | ||
``` | ||
Install npm develop dependencies, **in example folder** run: | ||
```bash | ||
yarn install | ||
# or | ||
# npm install | ||
``` | ||
After that you can build `rust project` to `WebAassembly` by using `wasm-pack`. | ||
```bash | ||
wasm-pack build ./my-crate --target web | ||
``` | ||
Now the `my-crate` module is ready, start vite dev server. | ||
```bash | ||
yarn dev | ||
or | ||
#npm run dev | ||
``` | ||
Done, if below is showing. | ||
```bash | ||
vite v2.3.8 dev server running at: | ||
> Local: http://localhost:3000/ | ||
ready in 169ms. | ||
``` | ||
--- | ||
## Install manually | ||
```bash | ||
yarn add vite vite-plugin-wasm-pack -D | ||
@@ -12,0 +63,0 @@ # or |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7794
111