rsw = rs(rust) → w(wasm)
- A command-line tool for automatically rebuilding local changes, based on the wasm-pack
implementation.
Englist | 简体中文
```bash
cargo install rsw ```
```bash
rsw -h
rsw init
rsw new
rsw watch
rsw build
rsw clean ```
```bash
RUST_LOG=rsw=info rsw
RUST_LOG=rsw rsw
Defines files/paths to be ignored. Similar to .gitignore
.
Example:
```bash
.js a/b//.txt !a/b//main.txt ```
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
- Profile name (optional)version
- Profile version (optional)interval
- Development mode rsw watch
, time interval for file changes to trigger wasm-pack build
, default 50
millisecondscli
- npm
| yarn
| pnpm
, default is npm
. Execute link
using the specified cli
, e.g. npm link
[new]
- Quickly generate a crate with wasm-pack new
, or set a custom template in rsw.toml -> [new] -> using
using
- wasm-pack
| rsw
| user
, default is wasm-pack
wasm-pack
- rsw new <name> --template <template> --mode <normal|noinstall|force>
wasm-pack new docrsw
- rsw new <name>
, built-in templatesuser
- rsw new <name>
, if dir
is not configured, use wasm-pack new <name>
to initialize the project.dir
- Copy all files in this directory. This field needs to be configured when using = "user"
. using = "wasm-pack"
or using = "rsw"
, this field will be ignored[[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, default is .
link
- true
| false
,default is false
, Whether to execute the link
command after this rust crate
is builttarget
- bundler
| nodejs
| web
| no-modules
, default is web
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.
rsw watch
- temp dir
watch
mode
[RSW::OK]
[RSW::ERR]
[RSW::NAME]
[RSW::PATH]
[RSW::BUILD]
wasm-pack build
error```toml
name = "rsw" version = "0.1.0"
50
millisecondsinterval = 50
[[crates]] link = true
npm
| yarn
| pnpm
, default is npm
cli = "npm"
[new]
wasm-pack
| rsw
| user
, default is wasm-pack
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 projectusing = "wasm-pack"
using = "user"
using = "wasm-pack"
or using = "rsw"
, this field will be ignoreddir = "my-template"
name
, other fields will use the default configuration[[crates]]
name = "rsw-hello"
npm link
: true
| false
, default is false
link = false
.
pkg
web
npm link
: true
| false
, default is false
true
dev
| profiling
, default is dev
true
release
| profiling
, default is release
```
MIT License © 2022 lencx