wasm size optimizations

This commit is contained in:
geoffsee
2025-07-02 20:14:37 -04:00
parent 7d2715e3cb
commit 1abe0047fc
3 changed files with 13 additions and 650 deletions

639
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -39,37 +39,21 @@ dev = [
# and android_shared_stdcxx/android-game-activity, since those are covered in `mobile`
[dependencies]
bevy = { version = "0.16", default-features = false, features = [
"animation",
"bevy_asset",
"bevy_color",
"bevy_core_pipeline",
"bevy_gilrs",
"bevy_gizmos",
"bevy_gltf",
"bevy_log",
"bevy_mesh_picking_backend",
"bevy_pbr",
"bevy_picking",
"bevy_render",
"bevy_scene",
"bevy_sprite",
"bevy_sprite_picking_backend",
"bevy_state",
"bevy_text",
"bevy_ui",
"bevy_ui_picking_backend",
"bevy_window",
"bevy_winit",
"custom_cursor",
"default_font",
"hdr",
"multi_threaded",
"png",
"smaa_luts",
"sysinfo_plugin",
"tonemapping_luts",
"webgl2",
"x11",
] }
bevy_kira_audio = { version = "0.23.0", features = ["android_shared_stdcxx"] }
bevy_asset_loader = { version = "0.23.0" }

View File

@@ -2,5 +2,13 @@
public_url = "./"
wasm_bindgen = "0.2.100"
[tools.wasm-bindgen]
# Enable wasm-opt for size optimization
wasm-opt = ["-Oz", "--enable-bulk-memory"]
[tools.wasm-opt]
# Additional wasm-opt optimizations for size
options = ["-Oz", "--enable-bulk-memory", "--enable-sign-ext", "--enable-mutable-globals"]
[serve]
port = 8080