From 2bd7482295daae4edfd367d84505bb43735cd410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 22 Feb 2023 18:21:07 +0100 Subject: fix(core): rebuild when JS sources for snapshotting change (#17876) --- core/runtime.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'core') diff --git a/core/runtime.rs b/core/runtime.rs index c028d97c2..1f325ad32 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -616,6 +616,16 @@ impl JsRuntime { .flat_map(|ext| ext.get_esm_sources().to_owned()) .collect::>(); + #[cfg(feature = "include_js_files_for_snapshotting")] + for source in &esm_sources { + use crate::ExtensionFileSourceCode; + if let ExtensionFileSourceCode::LoadedFromFsDuringSnapshot(path) = + &source.code + { + println!("cargo:rerun-if-changed={}", path.display()) + } + } + Rc::new(crate::modules::InternalModuleLoader::new( options.module_loader, esm_sources, -- cgit v1.2.3