1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-01 16:51:13 -05:00

fix(core): rebuild when JS sources for snapshotting change (#18976)

This commit is contained in:
Bartek Iwańczuk 2023-05-03 18:35:39 +02:00 committed by Levente Kurusa
parent 47b78b6b0a
commit 6526b1001a
No known key found for this signature in database
GPG key ID: 9F72F3C05BA137C4

View file

@ -543,6 +543,29 @@ impl JsRuntime {
}
}
#[cfg(feature = "include_js_files_for_snapshotting")]
{
let js_sources = options
.extensions
.iter()
.flat_map(|ext| match ext.get_js_sources() {
Some(s) => s.to_owned(),
None => vec![],
})
.collect::<Vec<ExtensionFileSource>>();
if snapshot_options != snapshot_util::SnapshotOptions::None {
for source in &js_sources {
use crate::ExtensionFileSourceCode;
if let ExtensionFileSourceCode::LoadedFromFsDuringSnapshot(path) =
&source.code
{
println!("cargo:rerun-if-changed={}", path.display())
}
}
}
}
Rc::new(crate::modules::ExtModuleLoader::new(
options.module_loader,
esm_sources,