feat(compile): ability to embed directory in executable (#26939)

This commit is contained in:
David Sherret 2024-11-19 18:20:14 -05:00 committed by GitHub
parent 46b6037644
commit 6b478cd0a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 50 additions and 6 deletions

View file

@ -620,9 +620,17 @@ impl<'a> DenoCompileBinaryWriter<'a> {
};
for include_file in include_files {
let path = deno_path_util::url_to_file_path(include_file)?;
vfs
.add_file_at_path(&path)
.with_context(|| format!("Including {}", path.display()))?;
if path.is_dir() {
// TODO(#26941): we should analyze if any of these are
// modules in order to include their dependencies
vfs
.add_dir_recursive(&path)
.with_context(|| format!("Including {}", path.display()))?;
} else {
vfs
.add_file_at_path(&path)
.with_context(|| format!("Including {}", path.display()))?;
}
}
let mut remote_modules_store = RemoteModulesStoreBuilder::default();
let mut code_cache_key_hasher = if self.cli_options.code_cache_enabled() {