Skip to content

Commit

Permalink
Export initSync for no-module builds (#3075)
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda authored Sep 9, 2022
1 parent 595b04b commit eac9722
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/cli-support/src/js/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,10 @@ impl<'a> Context<'a> {
js.push_str("const __exports = {};\n");
js.push_str("let wasm;\n");
init = self.gen_init(needs_manual_start, None)?;
footer.push_str(&format!("{} = Object.assign(init, __exports);\n", global));
footer.push_str(&format!(
"{} = Object.assign(init, {{ initSync }}, __exports);\n",
global
));
}

// With normal CommonJS node we need to defer requiring the wasm
Expand Down

0 comments on commit eac9722

Please sign in to comment.