-
Notifications
You must be signed in to change notification settings - Fork 438
Add a --target option target different environment (nodejs, browser) #125
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
Conversation
i'll look at rustfmt in a minute |
This LGTM, I think we just need you to format it with the latest rustfmt :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi! so thanks for starting on this. one of the reasons i had assigned this to myself tho is that i have a very specific design for it. wasm-bindgen has several non-compatible flags that affect the js output (https://github.com/rustwasm/wasm-bindgen#cli-reference). i dont personally care for this design because it allows you to pass several flags even tho they do not work together at all. i would like the design to be something like --module
or --output
that takes a single argument, one of the flags listed in the link.
Mea culpa — sorry for the steal. I see where you're going and like the idea. Some bikeshedding: What would be the valid options currently? I find the bindgen docs a bit confusing. I guess currently only those?
/edit rollup uses |
Does the update meet your expectations a bit more closely? As per TeXitoi/structopt#104, TeXitoi/structopt#110 I don't see a simple way to allow a list of possible values (an enum?). |
I'm not quite sure why travis fails - I tried updating rustfmt… The log says:
🤔 |
@djfarly - no worries on "stealing", i meant it more as an apology for filing a very vague feature issue 😅
FYI the travis failure was a breaking change in rustfmt that we(lol, actually YOU! https://github.com/ashleygwilliams/wasm-pack/pull/128) fixed. as for what should be supported- you can see the flags here: https://github.com/rustwasm/wasm-bindgen#cli-reference. i agree that the docs are a bit unwiedly to navigate- which is partially why wrapping wasm-bindgen up into wasm-pack will hopefully make it an easier user experience! i'm gonna take a slightly closer look at this- but i think we should probably be able to merge this today, or at least in the next few days! thank you so much for your efforts on this!! |
slurped this up, rebased it, added docs in https://github.com/ashleygwilliams/wasm-pack/pull/132. |
Implements #75
I had some time in the train – I hope it's okay.
Some lines of documentation and a few line breaks for readability included.
Thoughts?
Make sure these boxes are checked! 📦✅
rustfmt
installed and have yourcloned directory set to nightly
$ rustup override set nightly $ rustup component add rustfmt-preview --toolchain nightly
rustfmt
on the code base before submitting✨✨ 😄 Thanks so much for contributing to wasm-pack! 😄 ✨✨