diff --git a/Cargo.toml b/Cargo.toml index 8aadc00..15ad70f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,13 +11,19 @@ license = "MIT" crate-type = ["cdylib", "rlib"] [dependencies] -console_error_panic_hook = "0.1" serde = { version = "1.0", features = ["derive"] } serde_repr = "0.1" -serde-wasm-bindgen = "0.4" strum = "0.25" strum_macros = "0.25" -wasm-bindgen = "0.2" + +# WASM dependencies +console_error_panic_hook = { version = "0.1", optional = true } +serde-wasm-bindgen = { version = "0.4", optional = true } +wasm-bindgen = { version = "0.2", optional = true } [profile.release] opt-level = "s" + +[features] +default = ["wasm"] +wasm = ["dep:console_error_panic_hook", "dep:serde-wasm-bindgen", "dep:wasm-bindgen"] diff --git a/src/lib.rs b/src/lib.rs index 4d6c2a1..c3c9726 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,5 @@ mod calculate; mod data_types; mod info; +#[cfg(feature = "wasm")] mod wasm;