https://github.com/lencx/rsw-node
⚪️ `wasm-pack build` executed in remote deployment
https://github.com/lencx/rsw-node
Last synced: 3 months ago
JSON representation
⚪️ `wasm-pack build` executed in remote deployment
- Host: GitHub
- URL: https://github.com/lencx/rsw-node
- Owner: lencx
- License: mit
- Created: 2021-05-09T05:19:44.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-03T01:35:34.000Z (over 3 years ago)
- Last Synced: 2025-04-20T15:06:23.470Z (3 months ago)
- Language: Rust
- Homepage:
- Size: 7.36 MB
- Stars: 14
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rsw-node
[](https://www.npmjs.com/package/rsw-node)
[](https://npmjs.org/package/rsw-node)
[](https://discord.gg/euyYWXTwmk)[](https://www.rust-lang.org)
[](https://webassembly.org)`wasm-pack build` executed in remote deployment, use with [vite-plugin-rsw](https://github.com/lencx/vite-plugin-rsw).
## Pre-installed
* [rust](https://www.rust-lang.org/learn/get-started)
* [nodejs](https://nodejs.org)
* [wasm-pack](https://github.com/rustwasm/wasm-pack): `npm install -g wasm-pack`
* [vite-plugin-rsw](https://github.com/lencx/vite-plugin-rsw): `npm install -D vite-plugin-rsw`## Get Started
```bash
# rsw -h: command help
# You can use the `rsw` command alone
npm install -g rsw-node
```

## Usage
```bash
# install rsw
npm i -D rsw-node# or
yarn add -D rsw-node
``````bash
Usage:step1: create .rsw.json in the project root path.
step2: edit .rsw.json
crates - package name, support npm organization
{
"crates": []
}step3: edit package.json
{
"scripts": {
"rsw:build": "rsw && npm run build"
}
}
```For example:
```jsonc
// .rsw.json
{
"crates": [
"@rsw/chasm", // npm org
"game-of-life", // npm package
]
}
``````jsonc
// package.json
{
// ...
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
+ "rsw:build": "rsw && npm run build"
}
}
```Use `DEBUG=rsw:cmd` to enable [debug](https://github.com/visionmedia/debug) mode
## License
MIT License © 2021 [lencx](https://github.com/lencx)