diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-11-19 18:20:14 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-19 23:20:14 +0000 |
commit | 6b478cd0a3fdff15d5d9d8849a3019652b919921 (patch) | |
tree | a230be068b8c01b127ee4fd26a0e6d54239f1188 /cli/standalone | |
parent | 46b6037644c761369e689704f8e7b857959da155 (diff) |
feat(compile): ability to embed directory in executable (#26939)
Diffstat (limited to 'cli/standalone')
-rw-r--r-- | cli/standalone/binary.rs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/cli/standalone/binary.rs b/cli/standalone/binary.rs index 815399313..39e508dc3 100644 --- a/cli/standalone/binary.rs +++ b/cli/standalone/binary.rs @@ -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() { |