Package Exports
- vite-plugin-rsw
- vite-plugin-rsw/dist/index.js
- vite-plugin-rsw/dist/index.mjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vite-plugin-rsw) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
vite-plugin-rsw
wasm-pack plugin for Vite
| rsw version | vite version |
|---|---|
>= 2.0.0 |
>= 2.8.0 |
>= 1.8.0 |
>= 2.4.0 |
1.7.0 |
2.0.0 ~ 2.3.8 |
Pre-installed
Usage
Install
@rsw/cli: rsw = rs(rust) → w(wasm) - A command-line tool for automatically rebuilding local changes, based on the wasm-pack implementation.
# With NPM:
npm i -D vite-plugin-rsw @rsw/cli
# With Yarn:
yarn add -D vite-plugin-rsw @rsw/clipackage.json
Open two terminal windows, execute npm run rsw in the first and npm run dev in the second. Note: The order of execution is important, do not close the first window!
// package.json
"scripts": {
"dev": "vite",
"rsw": "rsw watch",
"build": "rsw build && yarn fe:build",
"fe:build": "tsc && vite build"
}Example
Demo - 🎲 Learning WebAssembly
微信
群二维码已过期,关注公众号《浮之静》,发送“进群”,我将拉你进群一起学习。

License
MIT License © 2021 lencx