Cargo Features

[dependencies]
aplang = { version = "0.1.10", default-features = false, features = ["native", "portable", "splash", "wasm"] }
native default = stacker

"native" feature for non-wasm platforms, enabling native dependencies

Enables color and suggestions of clap

dependencies based on features
bin

and fancy of miette

both

portable = clap

"portable" allows for fully static linking at the cost of low stack size
cargo build --no-default-features --features portable

Enables fancy-no-syscall of miette

splash default
wasm = js-sys, wasm-bindgen, web-sys

YOU SHALL NOT RUN AS A BINARY WITH THE WASM FEATURE!
"wasm" feature, enabling wasm-specific dependencies
cargo build --no-default-features --features wasm
RUSTFLAGS='--cfg getrandom_backend="wasm_js"'
you must set these flags to build for wasm

Enables wasm_js of getrandom, fancy-no-syscall of miette

Affects aplang::wasm

default = native, splash

default is empty, so you can explicitly opt-in to "wasm"

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

clap native portable?
miette native portable? wasm?
stacker native

Enables stacker

native

wasm-bindgen wasm?

Enables wasm-bindgen

wasm

js-sys wasm?

Enables js-sys

wasm

web-sys wasm?

Enables web-sys

wasm