rsw-0.1.0 is not a library.
Visit the last successful build:
rsw-0.8.0
「🌐 Language」简体中文
rsw = rs(rust) → w(wasm)
- A command-line tool for automatically rebuilding local changes, based on the wasm-pack
implementation.
rsw-rs
Feature
- rsw watch
- rsw build
TODO
- rsw init -
rsw.toml
- rsw new - rust crate
- wasm-pack new
- custom template
- deps watch - local sub-dependency file changes trigger hot updates
- debug info
Usage
# help
# dev
# release
rsw.toml
configuration file
Options
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 modersw watch
, time interval for file changes to triggerwasm-pack build
, default50
milliseconds[new]
- generate therust crate
[[crates]]
- is an array that supports multiplerust crate
configurationsname
- npm package name, supporting organization, e.g.@rsw/foo
root
- relative to the project root path, the default.
out-dir
- npm package output path, defaultpkg
[crates.watch]
- development moderun
- whether thiscrate
needs to be watching, default istrue
profile
-dev
|profiling
, default isdev
[crates.build]
- production moderun
- whether thiscrate
needs to be build, default istrue
profile
-release
|profiling
, default isrelease
Note: name
in [[crates]]
is required, other fields are optional.
Example
# rsw.toml
= "rsw"
= "0.1.0"
#! default value `50` ms
= 50
#! ---------------------------
#! rsw new <name>
[]
#! @see https://rustwasm.github.io/docs/wasm-pack/commands/new.html
#! use: wasm-pack | rsw | user
#! 1. wasm-pack: `rsw new <name> --template <template> --mode <normal|noinstall|force>`
#! 2. rsw: `rsw new <name>`, built-in templates
#! 3. user: `rsw new <name>`, if `dir` is not configured, use `wasm-pack new <name>` to initialize the project
= "wasm-pack"
#! this field needs to be configured when `use = "user"`
#! `use = "wasm-pack"` or `use = "rsw"`, this field will be ignored
= "my-template"
#! ################# NPM Package #################
#! When there is only `name`, other fields will use the default configuration
#! -------- package: rsw-hello --------
[[]]
= "rsw-hello"
#! =======================================================
#! -------- package: @rsw/hello --------
# [[crates]]
# #! default value `.`
# root = "."
# #! npm package name
# name = "@rsw/hello"
# #! default value `pkg`
# out-dir = "pkg"
# #! rsw watch
# [crates.watch]
# #! default value `true`
# run = false
# #! profile: `dev` | `profiling`, default value `dev`
# profile = "dev"
# #! rsw build
# [crates.build]
# run = false
# #! profile: `release` | `profiling`, default value `release`
# profile = "release"
License
MIT License © 2022 lencx