mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-12 12:31:22 +00:00
Add an option to "uglify" imports
This commit adds an option to "uglify" the wasm module's imports/exports so those which are controlled by bindgen are renamed to a shorter (probably one letter) names. This'll hopefully help cut down on both the wasm size slightly and also the generated JS as the glue we're talking to wasm over won't require such large names all the time.
This commit is contained in:
@ -37,9 +37,10 @@ fn main() {
|
||||
.unwrap_or_else(|e| e.exit());
|
||||
|
||||
let mut b = Bindgen::new();
|
||||
b.input_path(&args.arg_input);
|
||||
b.nodejs(args.flag_nodejs);
|
||||
b.debug(args.flag_debug);
|
||||
b.input_path(&args.arg_input)
|
||||
.nodejs(args.flag_nodejs)
|
||||
.debug(args.flag_debug)
|
||||
.uglify_wasm_names(!args.flag_debug);
|
||||
let ret = b.generate().expect("failed to generate bindings");
|
||||
if let Some(ref ts) = args.flag_output_ts {
|
||||
ret.write_ts_to(ts).expect("failed to write TypeScript output file");
|
||||
|
Reference in New Issue
Block a user