| 1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
| 2 | // SPDX-License-Identifier: MIT |
| 3 | |
| 4 | #[cfg (target_arch = "wasm32" )] |
| 5 | use wasm_bindgen::prelude::*; |
| 6 | |
| 7 | slint::slint! { |
| 8 | export { AppWindow } from "../ui/demo.slint" ; |
| 9 | } |
| 10 | |
| 11 | #[cfg_attr (target_arch = "wasm32" , wasm_bindgen(start))] |
| 12 | pub fn main() { |
| 13 | // This provides better error messages in debug mode. |
| 14 | // It's disabled in release mode so it doesn't bloat up the file size. |
| 15 | #[cfg (all(debug_assertions, target_arch = "wasm32" ))] |
| 16 | console_error_panic_hook::set_once(); |
| 17 | |
| 18 | AppWindow::new().expect("AppWindow::new() failed" ).run().expect("AppWindow::run() failed" ); |
| 19 | } |
| 20 | |