From 1ab5a03aeffa332354080ed4b625c3ccbc9a29c1 Mon Sep 17 00:00:00 2001 From: Steven Pecht Date: Sun, 13 Aug 2023 10:25:17 +1000 Subject: [PATCH] Use to identify cargo build artifact if present (#1344) --- packages/cli/src/builder.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/cli/src/builder.rs b/packages/cli/src/builder.rs index 3fa8e7818..332490fda 100644 --- a/packages/cli/src/builder.rs +++ b/packages/cli/src/builder.rs @@ -93,18 +93,21 @@ pub fn build(config: &CrateConfig, quiet: bool) -> Result { // [2] Establish the output directory structure let bindgen_outdir = out_dir.join("assets").join("dioxus"); - let release_type = match config.release { - true => "release", - false => "debug", + let build_profile = if config.custom_profile.is_some() { + config.custom_profile.as_ref().unwrap() + } else if config.release { + "release" + } else { + "debug" }; let input_path = match executable { ExecutableType::Binary(name) | ExecutableType::Lib(name) => target_dir - .join(format!("wasm32-unknown-unknown/{}", release_type)) + .join(format!("wasm32-unknown-unknown/{}", build_profile)) .join(format!("{}.wasm", name)), ExecutableType::Example(name) => target_dir - .join(format!("wasm32-unknown-unknown/{}/examples", release_type)) + .join(format!("wasm32-unknown-unknown/{}/examples", build_profile)) .join(format!("{}.wasm", name)), };