Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mtolmacs/vite-plugin-wasm-pack-watcher
A Vite plugin which recompiles your Rust WebAssembly project whenever you modify a Rust (*.rs) file.
https://github.com/mtolmacs/vite-plugin-wasm-pack-watcher
Last synced: 21 days ago
JSON representation
A Vite plugin which recompiles your Rust WebAssembly project whenever you modify a Rust (*.rs) file.
- Host: GitHub
- URL: https://github.com/mtolmacs/vite-plugin-wasm-pack-watcher
- Owner: mtolmacs
- License: mit
- Created: 2025-01-02T18:55:08.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2025-01-02T19:36:09.000Z (about 1 month ago)
- Last Synced: 2025-01-02T20:19:05.667Z (about 1 month ago)
- Language: TypeScript
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vite-plugin-wasm-pack-watcher
A Vite plugin which recompiles your Rust WebAssembly project whenever you modify
a Rust (\*.rs) file.## Usage
1. Add it to your `vite.config.(js|ts)` file and set the `build.watch` parameter
to listen for .rs file changes as well:```ts
import { defineConfig } from "vite";
import wasmPackWatchPlugin from "vite-plugin-wasm-pack-watcher";export default defineConfig({
build: {
watch: {
include: ["src/**/*.js", "src/**/*.ts", "src/**/*.rs"], // Watch for *.rs files
},
},
plugins: [
wasmPackWatchPlugin({
/*
buildCommand: ""
*/
}),
],
});
```> Note: Please note that this plugin is not a replacement for [vite-plugin-wasm](https://github.com/Menci/vite-plugin-wasm)
> or similar plugins!2. If you're importing the WASM package generated by `wasm-pack` in your package.json
you need to reference it as a "link", otherwise this plugin will keep reloading the old,
unchanged version!```json
{
"dependencies": {
"": "link:./pkg"
}
}
```