diff --git a/Cargo.lock b/Cargo.lock index 4ab86d8..43a2ae1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -302,6 +302,26 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "console_log" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be8aed40e4edbf4d3b4431ab260b63fdc40f5780a4766824329ea0f1eefe3c0f" +dependencies = [ + "log", + "web-sys", +] + [[package]] name = "core-foundation" version = "0.9.3" @@ -1409,12 +1429,18 @@ version = "0.1.0" dependencies = [ "async-executor", "bytemuck", + "console_error_panic_hook", + "console_log", "ddsfile", "env_logger", "glam", + "js-sys", "log", "obj", "pollster", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", "wgpu", "winit", ] diff --git a/Cargo.toml b/Cargo.toml index f6c2eea..ac5cc4a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,3 +16,13 @@ obj = "0.10.2" pollster = "0.3.0" wgpu = "0.17.0" winit = "0.28.6" + +# https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#platform-specific-dependencies + +[target.wasm32-unknown-unknown.dependencies] +console_error_panic_hook = "0.1.7" +console_log = "1.0.0" +js-sys = "0.3.64" +wasm-bindgen = "0.2.87" +wasm-bindgen-futures = "0.4.37" +web-sys = { version = "0.3.64", features = ["Location", "Window"] }