-
Notifications
You must be signed in to change notification settings - Fork 419
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 support for --target web
#567
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
use binary_install::{Cache, Download}; | ||
use child; | ||
use command::build::BuildProfile; | ||
use command::build::{BuildProfile, Target}; | ||
use emoji; | ||
use failure::{self, ResultExt}; | ||
use log::debug; | ||
|
@@ -176,7 +176,7 @@ pub fn wasm_bindgen_build( | |
bindgen: &Download, | ||
out_dir: &Path, | ||
disable_dts: bool, | ||
target: &str, | ||
target: &Target, | ||
profile: BuildProfile, | ||
step: &Step, | ||
) -> Result<(), failure::Error> { | ||
|
@@ -203,9 +203,10 @@ pub fn wasm_bindgen_build( | |
"--typescript" | ||
}; | ||
let target_arg = match target { | ||
"nodejs" => "--nodejs", | ||
"no-modules" => "--no-modules", | ||
_ => "--browser", | ||
Target::Nodejs => "--nodejs", | ||
Target::NoModules => "--no-modules", | ||
Target::Web => "--web", | ||
Target::Bundler => "--browser", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we perhaps deprecate There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that long term we may want to but for now it serves a purpose we haven't displaced, so it can't be removed just yet There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we want to open a tracking issue? let me know what you think. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've opened up rustwasm/wasm-bindgen#1332 for this |
||
}; | ||
let bindgen_path = bindgen.binary("wasm-bindgen")?; | ||
let mut cmd = Command::new(bindgen_path); | ||
|
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.
thanks for making this an enum it's a clear improvement!