From f4dbb267c6672f92605bc204b10ad9a96d160ef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sun, 17 Jan 2021 15:12:00 +0100 Subject: fix: incremental build for deno declaration files (#9138) --- cli/build.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'cli') 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 { -- cgit v1.2.3