-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --omit-imports flag #799
Conversation
Hmmm, I'm not sure if this is a good idea, we don't add all of the wasm-bindgen flags, especially the more obscure ones. It's always possible to use the wasm-bindgen flags by using
|
@Pauan are you sure that actually works? When I try modifying the npm script in the first example from
to
it does not work, but errors with the following:
From Am I missing something? |
@darinmorrison You're right, I guess I got confused. We really should have a way to send arbitrary arguments to wasm-bindgen. The only reason I see to send arguments to
However, this is a breaking change. @ashleygwilliams what do you think? |
Thanks for the clarification. A couple thoughts: First, I agree exposing Second, maybe it is worth considering another approach that would accomplish something similar to what you are describing but without being a breaking change. We could add two new flags: I don't have a strong opinion about doing it this way versus what you proposed. I could imagine it might still be useful to be able to pass arguments to But doing it this way with explicit |
I think that's reasonable. Though |
Closing in favor of #805. |
This PR adds an
--omit-imports
flag corresponding to thewasm-bindgen-cli
flag added upstream in rustwasm/wasm-bindgen#1958.This flag is useful for some scenarios where imports must be controlled through separate preloads scripts where items are brought into the application scope by modifying
global
orwindow
directly, instead of through the usualimport
orrequire
mechanisms.Examples of using this flag can be found in the
omit-imports
branch of electron-sys. See the activity-monitor example (with package.json and preload.js) and hash example with (with package.json and preload.js).