File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
crates/cli-support/src/js Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -415,6 +415,10 @@ impl<'a> Context<'a> {
415
415
if needs_manual_start {
416
416
footer. push_str ( "\n wasm.__wbindgen_start();\n " ) ;
417
417
}
418
+
419
+ if self . start_found {
420
+ footer. push_str ( "\n wasm.__wbindgen_main();\n " ) ;
421
+ }
418
422
}
419
423
420
424
OutputMode :: Deno => {
@@ -429,6 +433,10 @@ impl<'a> Context<'a> {
429
433
if needs_manual_start {
430
434
footer. push_str ( "\n wasm.__wbindgen_start();\n " ) ;
431
435
}
436
+
437
+ if self . start_found {
438
+ footer. push_str ( "\n wasm.__wbindgen_main();\n " ) ;
439
+ }
432
440
}
433
441
434
442
// With Bundlers and modern ES6 support in Node we can simply import
@@ -463,6 +471,12 @@ impl<'a> Context<'a> {
463
471
if needs_manual_start {
464
472
start = Some ( "\n wasm.__wbindgen_start();\n " . to_string ( ) ) ;
465
473
}
474
+
475
+ if self . start_found {
476
+ start
477
+ . get_or_insert_with ( String :: default)
478
+ . push_str ( "\n wasm.__wbindgen_main();\n " ) ;
479
+ }
466
480
}
467
481
468
482
// With a browser-native output we're generating an ES module, but
@@ -909,7 +923,7 @@ impl<'a> Context<'a> {
909
923
} else {
910
924
""
911
925
} ,
912
- main = if needs_manual_start && self . start_found {
926
+ main = if self . start_found {
913
927
"if (start == true) { wasm.__wbindgen_main(); }"
914
928
} else {
915
929
""
You can’t perform that action at this time.
0 commit comments