Sfoglia il codice sorgente

Feat(core) rebuild on dist dir change fix: #285 (#284)

* update .gitignore

* remove cargo.lock

* line to rebuild on a change to the dist folder.

* add expect
Tensor-Programming 5 anni fa
parent
commit
9625c0fdf6
1 ha cambiato i file con 6 aggiunte e 4 eliminazioni
  1. 6 4
      tauri/build.rs

+ 6 - 4
tauri/build.rs

@@ -4,13 +4,15 @@ extern crate tauri_includedir_codegen;
 pub fn main() {
   #[cfg(not(feature = "dev-server"))]
   {
+    println!(
+      "cargo:rerun-if-changed={}",
+      std::env::var("TAURI_DIST_DIR").expect("Unable to read dist directory")
+    );
     match std::env::var("TAURI_DIST_DIR") {
       Ok(dist_path) => {
         let inlined_assets = match std::env::var("TAURI_INLINED_ASSETS") {
-          Ok(assets) => {
-            assets.split("|").map(|s| s.to_string()).collect()
-          }
-          Err(_) => Vec::new()
+          Ok(assets) => assets.split("|").map(|s| s.to_string()).collect(),
+          Err(_) => Vec::new(),
         };
         // include assets
         tauri_includedir_codegen::start("ASSETS")