Make the web config optional in dioxus.toml (#2700)

This commit is contained in:
Evan Almloff 2024-07-25 04:23:09 +02:00 committed by GitHub
parent 7f210633eb
commit 163586c3ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -86,6 +86,7 @@ impl Platform {
pub struct DioxusConfig {
pub application: ApplicationConfig,
#[serde(default)]
pub web: WebConfig,
#[serde(default)]
@ -191,6 +192,20 @@ pub struct WebConfig {
pub wasm_opt: WasmOptConfig,
}
impl Default for WebConfig {
fn default() -> Self {
Self {
pre_compress: true_bool(),
app: Default::default(),
https: Default::default(),
wasm_opt: Default::default(),
proxy: Default::default(),
watcher: Default::default(),
resource: Default::default(),
}
}
}
/// The wasm-opt configuration
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct WasmOptConfig {