diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000..758ed610 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[target.wasm32-unknown-unknown] +runner = "wasm-server-runner" diff --git a/Cargo.toml b/Cargo.toml index 627d8ad0..99174d33 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,6 @@ edition = "2024" [dependencies] bevy = "0.16.0" -bevy_spatial = "0.11.0" # Grand-dependency pins ab_glyph = "0.2.16" @@ -17,6 +16,16 @@ miniz-sys = "0.1.10" nonmax = "0.5.1" rand = "0.8.0" +# Use regular bevy_spatial on non-WASM builds +[target.'cfg(not(target_arch = "wasm32"))'.dependencies] +bevy_spatial = "0.11.0" + +# Use bevy_spatial *without* the kdtree_rayon feature when building for WASM. +[target.'cfg(target_arch = "wasm32")'.dependencies.bevy_spatial] +version = "0.11.0" +default-features = false +features = ["kdtree"] + [profile.dev] opt-level = 1