mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-14 05:21:24 +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:
@ -23,6 +23,7 @@ Options:
|
||||
--nodejs Generate output that only works in node.js
|
||||
--browser Generate output that only works in a browser
|
||||
--no-modules Generate output that only works in a browser (without modules)
|
||||
--no-modules-global VAR Name of the global variable to initialize
|
||||
--typescript Output a TypeScript definition file
|
||||
--debug Include otherwise-extraneous debug checks in output
|
||||
--no-demangle Don't demangle Rust symbol names
|
||||
@ -39,6 +40,7 @@ struct Args {
|
||||
flag_debug: bool,
|
||||
flag_version: bool,
|
||||
flag_no_demangle: bool,
|
||||
flag_no_modules_global: Option<String>,
|
||||
arg_input: Option<PathBuf>,
|
||||
}
|
||||
|
||||
@ -65,6 +67,9 @@ fn main() {
|
||||
.debug(args.flag_debug)
|
||||
.demangle(!args.flag_no_demangle)
|
||||
.typescript(args.flag_typescript);
|
||||
if let Some(name) = &args.flag_no_modules_global {
|
||||
b.no_modules_global(name);
|
||||
}
|
||||
|
||||
let out_dir = match args.flag_out_dir {
|
||||
Some(ref p) => p,
|
||||
|
Reference in New Issue
Block a user