diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2021-01-17 15:12:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-17 15:12:00 +0100 |
commit | f4dbb267c6672f92605bc204b10ad9a96d160ef4 (patch) | |
tree | 731049593e3b0d9d6d522c17ec285fcd49595680 | |
parent | b26dcbc69d56b6ac5780520dad47f10460127d3e (diff) |
fix: incremental build for deno declaration files (#9138)
-rw-r--r-- | cli/build.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cli/build.rs b/cli/build.rs index 5b19ab71e..4d6295024 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -117,6 +117,15 @@ fn create_compiler_snapshot( "esnext.weakref", ]; + let path_dts = cwd.join("dts"); + // ensure we invalidate the build properly. + for name in libs.iter() { + println!( + "cargo:rerun-if-changed={}", + path_dts.join(format!("lib.{}.d.ts", name)).display() + ); + } + // create a copy of the vector that includes any op crate libs to be passed // to the JavaScript compiler to build into the snapshot let mut build_libs = libs.clone(); @@ -125,7 +134,6 @@ fn create_compiler_snapshot( } let re_asset = Regex::new(r"asset:/{3}lib\.(\S+)\.d\.ts").expect("bad regex"); - let path_dts = cwd.join("dts"); let build_specifier = "asset:///bootstrap.ts"; let mut js_runtime = JsRuntime::new(RuntimeOptions { |