Przeglądaj źródła

fix(tauri) properly rebuild when tauri conf changes (#787)

Lucas Fernandes Nogueira 5 lat temu
rodzic
commit
18452edd98
3 zmienionych plików z 6 dodań i 6 usunięć
  1. 5 0
      .changes/tauri-conf-changes.md
  2. 1 0
      tauri-api/build.rs
  3. 0 6
      tauri/build.rs

+ 5 - 0
.changes/tauri-conf-changes.md

@@ -0,0 +1,5 @@
+---
+"tauri-api": patch
+---
+
+Fixes the config reloading when tauri.conf.json changes.

+ 1 - 0
tauri-api/build.rs

@@ -14,6 +14,7 @@ pub fn main() -> Result<(), Box<dyn Error>> {
 
   match env::var_os("TAURI_CONFIG") {
     Some(tauri_config) => {
+      println!("cargo:rerun-if-env-changed=TAURI_CONFIG");
       let tauri_config_string = tauri_config.into_string().unwrap();
       write!(config_file, "{}", tauri_config_string)?;
     }

+ 0 - 6
tauri/build.rs

@@ -78,12 +78,6 @@ pub fn main() {
 }
 
 fn shared() {
-  if let Some(tauri_dir) = std::env::var_os("TAURI_DIR") {
-    let mut tauri_path = std::path::PathBuf::from(tauri_dir);
-    tauri_path.push("tauri.conf.json");
-    println!("cargo:rerun-if-changed={:?}", tauri_path);
-  }
-
   setup_env_aliases();
 }