1
0
Эх сурвалжийг харах

Call wasm main if debug start is missing

Joshua Kifer 3 жил өмнө
parent
commit
9aa64a0fa0
1 өөрчлөгдсөн 5 нэмэгдсэн , 1 устгасан
  1. 5 1
      src/assets/index.html

+ 5 - 1
src/assets/index.html

@@ -11,7 +11,11 @@
     <!-- Note the usage of `type=module` here as this is an ES6 module -->
     <script type="module">
       import init from "./assets/dioxus/{app_name}.js";
-      init("./assets/dioxus/{app_name}_bg.wasm");
+      init("./assets/dioxus/{app_name}_bg.wasm").then(wasm => {
+        if (wasm.__wbindgen_start == undefined) {
+          wasm.main();
+        }
+      });
     </script>
     {script_include}
   </body>