rsw-node
wasm-pack build
executed in remote deployment, use with vite-plugin-rsw.
Pre-installed
- rust
- nodejs
- wasm-pack:
npm install -g wasm-pack
- vite-plugin-rsw:
npm install -D vite-plugin-rsw
Get Started
# rsw -h: command help
# You can use the `rsw` command alone
npm install -g rsw-node
Step1
# install rsw
npm i -D rsw-node
# or
yarn add -D rsw-node
Step2
- Create
.rswrc.json
in the project root path. root
: The default is the project root path, which supports customization, but cannot exceed the project root path.crates
and [vite-plugin-rsw]: plugin options configuration is the same
For example:
{
"root": ".",
"crates": [
"@rsw/chasm",
"@rsw/game-of-life",
{ "name": "rsw-hello", "outDir": "custom/path" }
]
}
Step3
Add rsw:deploy
to package.json
{
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
+ "rsw:deploy": "rsw && npm run build"
},
}
Use DEBUG=rsw:cmd
to enable debug mode
DEBUG=rsw:cmd yarn rsw:deploy
License
MIT License © 2021 lencx