refactor(cli-config): modified CrateConfig struct

`out_dir` and `asset_dir` are now methods, because they derive from
`crate_dir` and `dioxus_config`.
This commit is contained in:
Andrew Voynov committed 2024-01-30 23:23:00 +03:00
1 parent fa933e35ab
commit 48957b11d8
7 files changed
+49 -42

No files matched your search

+1 -1
View File
@@ -221,7 +221,7 @@ fn start_desktop(config: &CrateConfig, skip_assets: bool) -> Result<(RAIIChild,
ExecutableType::Binary(name)
| ExecutableType::Lib(name)
| ExecutableType::Example(name) => {
let mut file = config.out_dir.join(name);
let mut file = config.out_dir().join(name);
if cfg!(windows) {
file.set_extension("exe");
}
+2 -2
View File
@@ -290,7 +290,7 @@ async fn setup_router(
std::fs::read_to_string(
file_service_config
.crate_dir
.join(file_service_config.out_dir)
.join(file_service_config.out_dir())
.join("index.html"),
)
.ok()
@@ -315,7 +315,7 @@ async fn setup_router(
Ok(response)
},
)
.service(ServeDir::new(config.crate_dir.join(&config.out_dir)));
.service(ServeDir::new(config.crate_dir.join(config.out_dir())));
// Setup websocket
let mut router = Router::new().route("/_dioxus/ws", get(ws_handler));