mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-17 15:01:23 +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:
@ -21,6 +21,7 @@ pub struct Bindgen {
|
||||
nodejs: bool,
|
||||
browser: bool,
|
||||
no_modules: bool,
|
||||
no_modules_global: Option<String>,
|
||||
debug: bool,
|
||||
typescript: bool,
|
||||
demangle: bool,
|
||||
@ -42,6 +43,7 @@ impl Bindgen {
|
||||
nodejs: false,
|
||||
browser: false,
|
||||
no_modules: false,
|
||||
no_modules_global: None,
|
||||
debug: false,
|
||||
typescript: false,
|
||||
demangle: true,
|
||||
@ -68,6 +70,11 @@ impl Bindgen {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn no_modules_global(&mut self, name: &str) -> &mut Bindgen {
|
||||
self.no_modules_global = Some(name.to_string());
|
||||
self
|
||||
}
|
||||
|
||||
pub fn debug(&mut self, debug: bool) -> &mut Bindgen {
|
||||
self.debug = debug;
|
||||
self
|
||||
|
Reference in New Issue
Block a user