pub struct BuildOptions {
pub path: Option<PathBuf>,
pub scope: Option<String>,
pub mode: InstallMode,
pub disable_dts: bool,
pub target: Target,
pub debug: bool,
pub dev: bool,
pub release: bool,
pub profiling: bool,
pub out_dir: String,
pub out_name: Option<String>,
pub extra_options: Vec<String>,
}
Expand description
Everything required to configure and run the wasm-pack build
command.
Fields
path: Option<PathBuf>
The path to the Rust crate. If not set, searches up the path from the current directory.
scope: Option<String>
The npm scope to use in package.json, if any.
mode: InstallMode
Sets steps to be run. [possible values: no-install, normal, force]
disable_dts: bool
By default a *.d.ts file is generated for the generated JS file, but this flag will disable generating this TypeScript file.
target: Target
Sets the target environment. [possible values: bundler, nodejs, web, no-modules]
debug: bool
Deprecated. Renamed to --dev
.
dev: bool
Create a development build. Enable debug info, and disable optimizations.
release: bool
Create a release build. Enable optimizations and disable debug info.
profiling: bool
Create a profiling build. Enable optimizations and debug info.
out_dir: String
Sets the output directory with a relative path.
out_name: Option<String>
Sets the output file names. Defaults to package name.
extra_options: Vec<String>
List of extra options to pass to cargo build
Trait Implementations
sourceimpl Debug for BuildOptions
impl Debug for BuildOptions
sourceimpl Default for BuildOptions
impl Default for BuildOptions
sourceimpl StructOpt for BuildOptions
impl StructOpt for BuildOptions
sourcefn from_clap(matches: &ArgMatches<'_>) -> Self
fn from_clap(matches: &ArgMatches<'_>) -> Self
Builds the struct from clap::ArgMatches
. It’s guaranteed to succeed
if matches
originates from an App
generated by StructOpt::clap
called on
the same type, otherwise it must panic. Read more
sourcefn from_args() -> Self
fn from_args() -> Self
Builds the struct from the command line arguments (std::env::args_os
).
Calls clap::Error::exit
on failure, printing the error message and aborting the program. Read more
sourcefn from_args_safe() -> Result<Self, Error>
fn from_args_safe() -> Result<Self, Error>
Builds the struct from the command line arguments (std::env::args_os
).
Unlike StructOpt::from_args
, returns clap::Error
on failure instead of aborting the program,
so calling .exit
is up to you. Read more
sourcefn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
Gets the struct from any iterator such as a Vec
of your making.
Print the error message and quit the program in case of failure. Read more
sourcefn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
Gets the struct from any iterator such as a Vec
of your making. Read more
Auto Trait Implementations
impl RefUnwindSafe for BuildOptions
impl Send for BuildOptions
impl Sync for BuildOptions
impl Unpin for BuildOptions
impl UnwindSafe for BuildOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more