diff --git a/.fleet/settings.json b/.fleet/settings.json new file mode 100644 index 000000000..e69de29bb diff --git a/src/config.rs b/src/config.rs index 309dcd9c0..5170f8756 100644 --- a/src/config.rs +++ b/src/config.rs @@ -6,9 +6,15 @@ use std::{collections::HashMap, fs::File, io::Read, path::PathBuf}; pub struct DioxusConfig { pub application: ApplicationConfig, pub web: WebConfig, + + #[serde(default = "default_plugin")] pub plugin: toml::Value, } +fn default_plugin() -> toml::Value { + toml::Value::Boolean(true) +} + impl DioxusConfig { pub fn load() -> crate::error::Result { let crate_dir = crate::cargo::crate_root()?; @@ -23,7 +29,7 @@ impl DioxusConfig { dioxus_conf_file.read_to_string(&mut meta_str)?; toml::from_str::(&meta_str) - .map_err(|_| crate::Error::Unique("Dioxus.toml parse failed".into())) + .map_err(|_| crate::Error::Unique("Dioxus.toml parse failed".into())) } } @@ -59,7 +65,7 @@ impl Default for DioxusConfig { script: Some(vec![]), }, }, - plugin: toml::Value::Table(toml::map::Map::new()) + plugin: toml::Value::Table(toml::map::Map::new()), } } } diff --git a/src/server/mod.rs b/src/server/mod.rs index 3e5f19e48..8bf7f3cb8 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -108,7 +108,6 @@ pub async fn startup_hot_reload(port: u16, config: CrateConfig) -> Result<()> { .clone() .unwrap_or_else(|| vec![PathBuf::from("src")]); - let watcher_config = config.clone(); let watcher_config = config.clone(); let mut watcher = RecommendedWatcher::new( move |evt: notify::Result| {