Skip to content

Pass arguments to wasm-bindgen #1092

@akriegman

Description

@akriegman

💡 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions