Przeglądaj źródła

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

Evan Almloff 11 miesięcy temu
rodzic
commit
163586c3ff
1 zmienionych plików z 15 dodań i 0 usunięć
  1. 15 0
      packages/cli-config/src/config.rs

+ 15 - 0
packages/cli-config/src/config.rs

@@ -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 {