diff --git a/crates/rpack_cli/Cargo.toml b/crates/rpack_cli/Cargo.toml index 10df20b..0e4736b 100644 --- a/crates/rpack_cli/Cargo.toml +++ b/crates/rpack_cli/Cargo.toml @@ -11,12 +11,14 @@ basis = ["dep:basis-universal"] dds = ["dep:image_dds"] [dependencies] -clap = { version = "4", features = ["derive"], optional = true } bevy_rpack = { default-features = false, path = "../bevy_rpack" } serde = { version = "1", features = ["derive"] } serde_json = "1" texture_packer = { version = "0.29", features = ["common"] } image = { version = "0.25", features = ["jpeg", "png"] } -glob = { version = "0.3", optional = true } + +[target.'cfg(not(target_arch = "wasm32"))'.dependencies] +clap = { version = "4", features = ["derive"], optional = true } basis-universal = { version = "0.3.1", optional = true } image_dds = { version = "0.6.2", optional = true } +glob = { version = "0.3", optional = true } \ No newline at end of file diff --git a/crates/rpack_cli/src/lib.rs b/crates/rpack_cli/src/lib.rs index 0f5ca3c..c409305 100644 --- a/crates/rpack_cli/src/lib.rs +++ b/crates/rpack_cli/src/lib.rs @@ -92,7 +92,7 @@ impl Spritesheet { }) } - #[cfg(feature = "dds")] + #[cfg(all(feature = "dds", not(target_arch = "wasm32")))] pub fn save_as_dds(&self, output_path: R) where R: AsRef, @@ -112,7 +112,7 @@ impl Spritesheet { dds.write(&mut writer).unwrap(); } - #[cfg(feature = "basis")] + #[cfg(all(feature = "basis", not(target_arch = "wasm32")))] pub fn save_as_basis(&self, output_path: R) where R: AsRef, diff --git a/crates/rpack_cli/src/main.rs b/crates/rpack_cli/src/main.rs index 2364819..149c201 100644 --- a/crates/rpack_cli/src/main.rs +++ b/crates/rpack_cli/src/main.rs @@ -1,7 +1,6 @@ -use std::{fmt::Display, io::Write, path::Path}; - use clap::{Parser, ValueEnum}; use rpack_cli::{ImageFile, Spritesheet}; +use std::{fmt::Display, io::Write, path::Path}; #[derive(Clone, Debug, Default, Copy, ValueEnum)] pub enum SaveImageFormat {