「🌐 Language」简体中文
rsw = rs(rust) → w(wasm)
- A command-line tool for automatically rebuilding local changes, based on the wasm-pack
implementation.
rsw.toml
bash
cargo install rsw
```bash
rsw -h
rsw watch
rsw build ```
configuration file
Create rsw.toml
in the project root path, configure the rust crate
parameter, and run the rsw watch
or rsw build
command.
name
- optional
version
- optional
interval
- development mode rsw watch
, time interval for file changes to trigger wasm-pack build
, default 50
milliseconds[new]
- generate the rust crate
[[crates]]
- is an array that supports multiple rust crate
configurations
name
- npm package name, supporting organization, e.g. @rsw/foo
root
- relative to the project root path, the default .
out-dir
- npm package output path, default pkg
[crates.watch]
- development moderun
- whether this crate
needs to be watching, default is true
profile
- dev
| profiling
, default is dev
[crates.build]
- production moderun
- whether this crate
needs to be build, default is true
profile
- release
| profiling
, default is release
Note: name
in [[crates]]
is required, other fields are optional.
```toml
name = "rsw" version = "0.1.0"
50
msinterval = 50
[new]
rsw new <name> --template <template> --mode <normal|noinstall|force>
rsw new <name>
, built-in templatesrsw new <name>
, if dir
is not configured, use wasm-pack new <name>
to initialize the projectuse = "wasm-pack"
use = "user"
use = "wasm-pack"
or use = "rsw"
, this field will be ignoreddir = "my-template"
name
, other fields will use the default configuration[[crates]] name = "rsw-hello"
.
pkg
true
dev
| profiling
, default value dev
release
| profiling
, default value release
```
MIT License © 2022 lencx