Skip to main content

is_dev

Function is_dev 

Source
pub fn is_dev() -> bool
Expand description

Whether the app is being compiled for development (tauri dev) or not.

It reads the DEP_TAURI_DEV environment variable, which is set by the build script of the tauri crate from the cargo:dev instruction, and is true when the tauri crate is compiled without the custom-protocol Cargo feature.

try_build uses it to define the dev cfg alias, so prefer #[cfg(dev)] on your app code; this function is meant for build.rs code that must branch on the development build.

ยงPanics

Panics if the DEP_TAURI_DEV environment variable is not set, which means the crate calling it does not depend on a tauri version that emits the cargo:dev instruction. Update the tauri dependency to the latest version to fix it.