File tree 1 file changed +9
-8
lines changed
crates/cli-support/src/js
1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -615,6 +615,15 @@ impl<'a> Context<'a> {
615
615
if self . config . emit_start {
616
616
self . add_start_function ( ) ?;
617
617
has_start_function = self . unstart_start_function ( ) ;
618
+
619
+ // In the "we're pretending to be an ES module use case if we've got
620
+ // a start function then we use an injected shim to actually execute
621
+ // the real start function on the next tick of the microtask queue
622
+ // (explained above)
623
+ if !self . config . no_modules && has_start_function {
624
+ self . inject_start_shim ( ) ;
625
+ }
626
+
618
627
}
619
628
620
629
self . export_table ( ) ?;
@@ -786,14 +795,6 @@ impl<'a> Context<'a> {
786
795
} ,
787
796
)
788
797
} else {
789
- // In the "we're pretending to be an ES module use case if we've got
790
- // a start function then we use an injected shim to actually execute
791
- // the real start function on the next tick of the microtask queue
792
- // (explained above)
793
- if has_start_function {
794
- self . inject_start_shim ( ) ;
795
- }
796
-
797
798
let import_wasm = if self . globals . len ( ) == 0 {
798
799
String :: new ( )
799
800
} else if self . use_node_require ( ) {
You can’t perform that action at this time.
0 commit comments