feat(config): configure wasm build settings

This commit is contained in:
gbrochar 2023-05-18 00:31:54 +02:00
parent faf326203e
commit 8f5281e5f2
2 changed files with 7 additions and 2 deletions

View File

@ -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"

View File

@ -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()