diff --git a/crates/bevy_asset/Cargo.toml b/crates/bevy_asset/Cargo.toml index 9f659b79c9ad2..eb5e2ce6a298a 100644 --- a/crates/bevy_asset/Cargo.toml +++ b/crates/bevy_asset/Cargo.toml @@ -38,7 +38,6 @@ parking_lot = { version = "0.12", features = ["arc_lock", "send_guard"] } ron = "0.8" serde = { version = "1", features = ["derive"] } thiserror = "1.0" -notify-debouncer-full = { version = "0.3.1", optional = true } [target.'cfg(target_os = "android")'.dependencies] bevy_winit = { path = "../bevy_winit", version = "0.12.0" } @@ -49,5 +48,8 @@ web-sys = { version = "0.3", features = ["Request", "Window", "Response"] } wasm-bindgen-futures = "0.4" js-sys = "0.3" +[target.'cfg(not(target_arch = "wasm32"))'.dependencies] +notify-debouncer-full = { version = "0.3.1", optional = true } + [dev-dependencies] bevy_core = { path = "../bevy_core", version = "0.12.0" } diff --git a/crates/bevy_asset/src/io/mod.rs b/crates/bevy_asset/src/io/mod.rs index 14e52cddcb597..a8e185d91caa6 100644 --- a/crates/bevy_asset/src/io/mod.rs +++ b/crates/bevy_asset/src/io/mod.rs @@ -1,3 +1,10 @@ +#[cfg(all(feature = "file_watcher", target_arch = "wasm32"))] +compile_error!( + "The \"file_watcher\" feature for hot reloading does not work \ + on WASM.\nDisable \"file_watcher\" \ + when compiling to WASM" +); + #[cfg(target_os = "android")] pub mod android; pub mod embedded;