Pass arguments to wasm-bindgen
💡 Feature description
Right now wasm-pack allows passing arguments to cargo build, but doesn't do the same for wasm-bindgen. I feel like this should be a pretty important feature to have. In my case, I want to use --weak-refs flag with wasm-bindgen, and at the moment I see no way to use this feature while using wasm-pack.
For the syntax, we could add a flag:
# Like this:
wasm-pack --wbg-arg --weak-refs --wbg-arg --reference-types
# Or this:
wasm-pack --wbg-args '--weak-refs --reference-types'
The only problem I see with this syntax is it's different from the syntax for passing arguments to cargo, which is done with the -- flag. That's a bit unfortunate, but ¯\_(ツ)_/¯.
So, what do people think?
#937 adds --weak-refs like any other flag, but I agree that there should be a mechanism to pass arbitrary flags to wasm-bindgen
+1 as I need --omit-default-module-path
Hi @drager, I don't think this issue should be closed. To this day, there's no viable way of passing arbitrary arguments to wasm-bindgen. wasm-pack currently only supports passing a subset of the arguments that are explicitly filtered and captured in its source code (e.g., --weak-refs and --reference-types).