feat: default plugin info
This commit is contained in:
1 parent
39e38917d6
commit
bbc9e1b3a2
3 files changed
+7
-2
No files matched your search
Whitespace-only changes.
+7
-1
@@ -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<DioxusConfig> {
|
||||
let crate_dir = crate::cargo::crate_root()?;
|
||||
@@ -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()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<notify::Event>| {
|
||||
|
||||
Reference in new issue
Block a user