pub struct WasmConfig {Show 23 fields
pub package_name: Option<String>,
pub exclude_functions: Vec<String>,
pub exclude_types: Vec<String>,
pub type_overrides: HashMap<String, String>,
pub features: Option<Vec<String>>,
pub extra_features: Vec<String>,
pub serde_rename_all: Option<String>,
pub type_prefix: Option<String>,
pub env_shims: Vec<String>,
pub extra_dependencies: HashMap<String, Value>,
pub extra_dev_dependencies: HashMap<String, Value>,
pub rename_fields: HashMap<String, String>,
pub run_wrapper: Option<String>,
pub extra_lint_paths: Vec<String>,
pub crate_dir: Option<String>,
pub core_crate_override: Option<String>,
pub exclude_extra_dependencies: Vec<String>,
pub custom_rust_modules: Vec<String>,
pub exclude_fields: HashMap<String, Vec<String>>,
pub source_crate_remaps: Vec<String>,
pub languages: Vec<String>,
pub targets: Vec<String>,
pub wasm_opt: Vec<String>,
}Fields§
§package_name: Option<String>npm package name for the WASM package. Defaults to the Node package
name with a trailing -node removed, plus -wasm.
exclude_functions: Vec<String>§exclude_types: Vec<String>§type_overrides: HashMap<String, String>§features: Option<Vec<String>>§extra_features: Vec<String>Core-crate features to declare as opt-in passthrough features on the
generated WASM binding crate without enabling them on its core dependency.
Each entry name emits name = ["<core-crate>/name"] in [features].
serde_rename_all: Option<String>Override the serde rename_all strategy for JSON field names (e.g. “camelCase”, “snake_case”). When set, this takes priority over the IR type-level serde_rename_all.
type_prefix: Option<String>Prefix for generated type names (e.g. “Wasm” produces WasmConversionOptions).
Defaults to "Wasm".
env_shims: Vec<String>Wide-character C functions to shim for WASM external scanner interop.
extra_dependencies: HashMap<String, Value>Additional Cargo dependencies for the WASM binding crate only.
extra_dev_dependencies: HashMap<String, Value>Additional [dev-dependencies] entries for the generated WASM binding
crate’s Cargo.toml. Declares test-only dependencies for hand-written
test files (e.g. wasm-bindgen-test for in-crate #[wasm_bindgen_test]
suites) without hand-editing the generated manifest.
rename_fields: HashMap<String, String>Per-field name remapping for this language. Key is TypeName.field_name, value is the
desired binding field name. Applied after automatic keyword escaping.
run_wrapper: Option<String>Prefix wrapper for default tool invocations. When set, prepends this string to default commands across all pipelines (lint, test, build, etc.).
extra_lint_paths: Vec<String>Extra paths to append to default lint commands (format, check, typecheck).
crate_dir: Option<String>Overrides the default crates/{name}-wasm formula for the crate directory.
Useful when the Rust crate directory does not follow the alef convention
(e.g., consumer strips a -rs suffix so actual crate dir is crates/sample-markdown-wasm
instead of crates/sample-markdown-rs-wasm). Used by setup, test, clean, and format tasks.
core_crate_override: Option<String>Override the core Cargo dependency name and path for the WASM binding crate.
When set, the binding Cargo.toml depends on this crate (resolved as
../<override>) instead of the umbrella [crate.name]. Use this to point
the WASM binding at a wasm-safe sub-crate while other languages keep the
facade. Defaults to unset.
exclude_extra_dependencies: Vec<String>Keys to subtract from the merged extra_dependencies set for this
language only. Useful when [crate.extra_dependencies] lists sibling
crates that the WASM target cannot link.
custom_rust_modules: Vec<String>Hand-written Rust modules to declare in the generated lib.rs with pub mod <name>;
and re-export with pub use <name>::*;. This is the knob for Rust-side dispatch/glue
modules under wasm. Note that [custom_modules].wasm is NOT consumed by the wasm
backend (no code path reads it) — use this field instead.
exclude_fields: HashMap<String, Vec<String>>Per-type field exclusions for the generated From impls and binding struct.
Key is the type name (e.g. “ServerConfig”), value is a list of field names to skip.
Use when source fields are gated behind #[cfg(not(target_arch = "wasm32"))] and
therefore don’t exist in the wasm32 compilation environment.
source_crate_remaps: Vec<String>Source crate names whose types are re-exported by the core_crate_override
crate. References to <original_crate>::TypeName in generated code are
rewritten to <override_crate>::TypeName. Only meaningful when
core_crate_override is set.
Example: with core_crate_override = "mylib-http", setting
source_crate_remaps = ["mylib-core", "mylib"] rewrites
mylib_core::Method and mylib::Method references to
mylib_http::Method (assumes mylib-http re-exports them via
pub use mylib_core::*).
languages: Vec<String>List of static-compiled languages supported by WASM.
When set, e2e smoke tests will auto-skip for languages not in this list,
emitting .skip("not in WASM's static language set") for each unsupported language.
This bridges the gap between the full 305-language pack and the 8-language
WASM build compiled with SAMPLE_LANGUAGES=python,rust,javascript,typescript,go,html,css,json.
Defaults to empty (all languages assumed supported).
targets: Vec<String>wasm-pack build targets to generate and publish. Each entry produces a
pkg/<target> build plus a build:wasm:<target> script; build:all
builds exactly this set, and files/main/module/types are derived
from it. Every target embeds its own full copy of the wasm binary, so
restricting this to a single target (e.g. ["web"]) keeps the published
npm package small — the web ES module is consumed by browsers, CDNs,
bundlers, Deno (npm:), and Node 22+. Valid entries: web, bundler,
nodejs, deno. Defaults to all four for backward compatibility.
wasm_opt: Vec<String>wasm-opt pass arguments, emitted as
[package.metadata.wasm-pack.profile.release] wasm-opt = [...]. When set to
a non-empty list, wasm-pack runs wasm-opt with these flags (e.g. ["-Oz"]
to minimize binary size, keeping large builds under a CDN per-file cap).
Defaults to empty, which emits wasm-opt = false so wasm-pack skips the pass
(the historical default; unchanged for consumers that don’t set it).
Trait Implementations§
Source§impl Clone for WasmConfig
impl Clone for WasmConfig
Source§fn clone(&self) -> WasmConfig
fn clone(&self) -> WasmConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WasmConfig
impl Debug for WasmConfig
Source§impl<'de> Deserialize<'de> for WasmConfig
impl<'de> Deserialize<'de> for WasmConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for WasmConfig
impl JsonSchema for WasmConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for WasmConfig
impl RefUnwindSafe for WasmConfig
impl Send for WasmConfig
impl Sync for WasmConfig
impl Unpin for WasmConfig
impl UnsafeUnpin for WasmConfig
impl UnwindSafe for WasmConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more