Skip to content

Commit

Permalink
Use js extension for node module output
Browse files Browse the repository at this point in the history
  • Loading branch information
Systemcluster committed Jul 31, 2024
1 parent 4d63628 commit 4685879
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crates/cli-support/src/js/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,15 @@ impl<'a> Context<'a> {
OutputMode::Bundler { .. } | OutputMode::Node { module: true } => {
for (id, js) in crate::sorted_iter(&self.wasm_import_definitions) {
let import = self.module.imports.get_mut(*id);
import.module = format!("./{}_bg.js", module_name);
import.module = format!(
"./{}_bg.{}",
module_name,
if self.config.mode.nodejs() {
"jsm"
} else {
"js"
}
);
if let Some(body) = js.strip_prefix("function") {
footer.push_str("\nexport function ");
footer.push_str(&import.name);
Expand Down

0 comments on commit 4685879

Please sign in to comment.