pub struct BuildConfig {
    pub runner: Option<String>,
    pub dev_path: AppUrl,
    pub dist_dir: AppUrl,
    pub before_dev_command: Option<BeforeDevCommand>,
    pub before_build_command: Option<HookCommand>,
    pub before_bundle_command: Option<HookCommand>,
    pub features: Option<Vec<String>>,
    pub with_global_tauri: bool,
}
Expand description

The Build configuration object.

Fields

runner: Option<String>

The binary used to build and run the application.

dev_path: AppUrl

The path to the application assets or URL to load in development.

This is usually an URL to a dev server, which serves your application assets with live reloading. Most modern JavaScript bundlers provides a way to start a dev server by default.

See vite, Webpack DevServer and sirv for examples on how to set up a dev server.

dist_dir: AppUrl

The path to the application assets or URL to load in production.

When a path relative to the configuration file is provided, it is read recursively and all files are embedded in the application binary. Tauri then looks for an index.html file unless you provide a custom window URL.

You can also provide a list of paths to be embedded, which allows granular control over what files are added to the binary. In this case, all files are added to the root and you must reference it that way in your HTML files.

When an URL is provided, the application won’t have bundled assets and the application will load that URL by default.

before_dev_command: Option<BeforeDevCommand>

A shell command to run before tauri dev kicks in.

The TAURI_PLATFORM, TAURI_ARCH, TAURI_FAMILY, TAURI_PLATFORM_VERSION, TAURI_PLATFORM_TYPE and TAURI_DEBUG environment variables are set if you perform conditional compilation.

before_build_command: Option<HookCommand>

A shell command to run before tauri build kicks in.

The TAURI_PLATFORM, TAURI_ARCH, TAURI_FAMILY, TAURI_PLATFORM_VERSION, TAURI_PLATFORM_TYPE and TAURI_DEBUG environment variables are set if you perform conditional compilation.

before_bundle_command: Option<HookCommand>

A shell command to run before the bundling phase in tauri build kicks in.

The TAURI_PLATFORM, TAURI_ARCH, TAURI_FAMILY, TAURI_PLATFORM_VERSION, TAURI_PLATFORM_TYPE and TAURI_DEBUG environment variables are set if you perform conditional compilation.

features: Option<Vec<String>>

Features passed to cargo commands.

with_global_tauri: bool

Whether we should inject the Tauri API on window.__TAURI__ or not.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. 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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.