diff --git a/Cargo.toml b/Cargo.toml index a4ffc1f..9f5efbb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,9 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bevy = { version = "0.10.1", features = ["dynamic_linking"] } +bevy = { version = "0.10.1" } +# Dynamic linking is not supported by wasm build +# bevy = { version = "0.10.1", features = ["dynamic_linking"] } # Enable a small amount of optimization in debug mode [profile.dev] @@ -15,3 +17,6 @@ opt-level = 1 # Enable high optimizations for dependencies (incl. Bevy), but not for our code: [profile.dev.package."*"] opt-level = 3 + +[target.wasm32-unknown-unknown] +runner = "wasm-server-runner" diff --git a/src/main.rs b/src/main.rs index 0b6171d..d8877d6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,7 +30,7 @@ fn main() { resolution:(640., 480.).into(), present_mode: PresentMode::AutoVsync, // Tells wasm to resize the window according to the available canvas - fit_canvas_to_parent: false, + fit_canvas_to_parent: true, // Tells wasm not to override default event handling, like F5, Ctrl+R etc. prevent_default_event_handling: false, ..default()