feat(config): configure wasm build settings
This commit is contained in:
parent
faf326203e
commit
8f5281e5f2
|
@ -6,7 +6,9 @@ edition = "2021"
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[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
|
# Enable a small amount of optimization in debug mode
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
|
@ -15,3 +17,6 @@ opt-level = 1
|
||||||
# Enable high optimizations for dependencies (incl. Bevy), but not for our code:
|
# Enable high optimizations for dependencies (incl. Bevy), but not for our code:
|
||||||
[profile.dev.package."*"]
|
[profile.dev.package."*"]
|
||||||
opt-level = 3
|
opt-level = 3
|
||||||
|
|
||||||
|
[target.wasm32-unknown-unknown]
|
||||||
|
runner = "wasm-server-runner"
|
||||||
|
|
|
@ -30,7 +30,7 @@ fn main() {
|
||||||
resolution:(640., 480.).into(),
|
resolution:(640., 480.).into(),
|
||||||
present_mode: PresentMode::AutoVsync,
|
present_mode: PresentMode::AutoVsync,
|
||||||
// Tells wasm to resize the window according to the available canvas
|
// 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.
|
// Tells wasm not to override default event handling, like F5, Ctrl+R etc.
|
||||||
prevent_default_event_handling: false,
|
prevent_default_event_handling: false,
|
||||||
..default()
|
..default()
|
||||||
|
|
Loading…
Reference in New Issue