🚚 vite-plugin-wasm-pack
Vite plugin for wasm-pack rust
Install
yarn add vite vite-plugin-wasm-pack -D
Usage
Add this plugin to vite.config.ts
import { defineConfig } from 'vite';
import wasmPack from 'vite-plugin-wasm-pack';
export default defineConfig({
build: {
minify: false
},
plugins: [wasmPack('./my-crate')]
});
⚠ Don't forget to build your wasm-pack crate first!
wasm-pack build ./my-crate --target web
Add command to package.json
"scripts": {
"dev": "vite",
"build": "vite build"
}
Start dev server, and install my-crate
that you build earlier.
yarn dev
Complete example
please check ./example folder.
License
MIT, see the license file