diff --git a/Cargo.lock b/Cargo.lock index 58f5f7f2b..aaa373ec3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -572,7 +572,7 @@ dependencies = [ "chrono", "clap", "colored 2.0.0", - "convert_case", + "convert_case", "ctrlc", "dioxus-core", "dioxus-rsx", @@ -609,7 +609,7 @@ dependencies = [ [[package]] name = "dioxus-core" version = "0.2.1" -source = "git+https://github.com/dioxuslabs/dioxus/#928b5358b2b56b8431be9b8f4aba8130fd45cb08" +source = "git+https://github.com/dioxuslabs/dioxus/#f89cd204557f09febebf1afc48f418ad6ebc5254" dependencies = [ "backtrace", "bumpalo", @@ -621,6 +621,7 @@ dependencies = [ "log", "longest-increasing-subsequence", "once_cell", + "rustc-hash", "serde", "slab", "smallvec", @@ -629,7 +630,7 @@ dependencies = [ [[package]] name = "dioxus-rsx" version = "0.0.0" -source = "git+https://github.com/dioxuslabs/dioxus/#928b5358b2b56b8431be9b8f4aba8130fd45cb08" +source = "git+https://github.com/dioxuslabs/dioxus/#f89cd204557f09febebf1afc48f418ad6ebc5254" dependencies = [ "dioxus-core", "proc-macro2", diff --git a/docs/src/configure.md b/docs/src/configure.md index 97d4c9f55..ac922f5a6 100644 --- a/docs/src/configure.md +++ b/docs/src/configure.md @@ -25,7 +25,7 @@ We use `toml` to define some info for `dioxus` project. asset_dir = "public" ``` -### Application.Tool +### Application.Tools You can combine different tools with `dioxus`. @@ -168,4 +168,4 @@ style = [] # Javascript code file script = [] -``` \ No newline at end of file +``` diff --git a/src/builder.rs b/src/builder.rs index 88b6f43b4..5d192dfc0 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -284,12 +284,6 @@ pub fn build_desktop(config: &CrateConfig, is_serve: bool) -> Result<()> { } if output.status.success() { - // this code will clean the output dir. - // if using the serve, we will not clean the out_dir. - if config.out_dir.is_dir() && !is_serve { - remove_dir_all(&config.out_dir)?; - } - let release_type = match config.release { true => "release", false => "debug", diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index 6619da53d..841e72d10 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -1,5 +1,6 @@ use super::*; use std::{ + fs::create_dir_all, io::Write, path::PathBuf, process::{Command, Stdio}, @@ -49,7 +50,7 @@ impl Serve { if cfg!(windows) { file.set_extension("exe"); } - Command::new(crate_config.out_dir.join(file).to_str().unwrap()) + Command::new(file.to_str().unwrap()) .stdout(Stdio::inherit()) .output()?; } @@ -71,19 +72,19 @@ impl Serve { pub fn regen_dev_page(crate_config: &CrateConfig) -> Result<()> { let serve_html = gen_page(&crate_config.dioxus_config, true); - let mut file = std::fs::File::create( + let dist_path = crate_config.crate_dir.join( crate_config - .crate_dir - .join( - crate_config - .dioxus_config - .application - .out_dir - .clone() - .unwrap_or_else(|| PathBuf::from("dist")), - ) - .join("index.html"), - )?; + .dioxus_config + .application + .out_dir + .clone() + .unwrap_or_else(|| PathBuf::from("dist")), + ); + if !dist_path.is_dir() { + create_dir_all(&dist_path)?; + } + let index_path = dist_path.join("index.html"); + let mut file = std::fs::File::create(index_path)?; file.write_all(serve_html.as_bytes())?; Ok(())