mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-16 14:31:22 +00:00
Add a --no-modules-global
flag
This can be used to configure the name of the global that's initialized so it's not unconditionally `wasm_bindgen`. Closes #145
This commit is contained in:
@ -295,11 +295,15 @@ impl<'a> Context<'a> {
|
||||
return;
|
||||
}});
|
||||
}};
|
||||
self.wasm_bindgen = Object.assign(init, __exports);
|
||||
self.{global_name} = Object.assign(init, __exports);
|
||||
}})();
|
||||
",
|
||||
globals = self.globals,
|
||||
module = module_name,
|
||||
global_name = self.config.no_modules_global
|
||||
.as_ref()
|
||||
.map(|s| &**s)
|
||||
.unwrap_or("wasm_bindgen"),
|
||||
)
|
||||
} else {
|
||||
let import_wasm = if self.config.nodejs {
|
||||
|
Reference in New Issue
Block a user