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

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Returns clap::App corresponding to the struct.

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

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

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

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

Gets the struct from any iterator such as a Vec of your making. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.