mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-13 07:36:07 +00:00
Don't import wasm in generated JS if it's not used
Mostly just an edge case
This commit is contained in:
parent
0603faa57a
commit
247ea628fb
@ -410,7 +410,9 @@ impl<'a> Context<'a> {
|
|||||||
.unwrap_or("wasm_bindgen"),
|
.unwrap_or("wasm_bindgen"),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
let import_wasm = if self.config.nodejs {
|
let import_wasm = if self.globals.len() == 0 {
|
||||||
|
String::new()
|
||||||
|
} else if self.config.nodejs {
|
||||||
self.footer
|
self.footer
|
||||||
.push_str(&format!("wasm = require('./{}_bg');", module_name));
|
.push_str(&format!("wasm = require('./{}_bg');", module_name));
|
||||||
format!("var wasm;")
|
format!("var wasm;")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user