diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-11-19 23:59:04 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-19 23:59:04 +0000 |
commit | 71b6f0b0652cda2476dc0f2ea3ef205b80994411 (patch) | |
tree | 04333154fabc8724dd525b41502e6ed69b39984b /cli | |
parent | 21bd818f1ee531a49c46213417774fbc18a8b562 (diff) | |
parent | 6b478cd0a3fdff15d5d9d8849a3019652b919921 (diff) |
Merge branch 'main' into main
Diffstat (limited to 'cli')
-rw-r--r-- | cli/args/flags.rs | 6 | ||||
-rw-r--r-- | cli/standalone/binary.rs | 14 |
2 files changed, 14 insertions, 6 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 85b8abefe..f40d5aed4 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -1909,10 +1909,10 @@ On the first invocation with deno will download the proper binary and cache it i Arg::new("include") .long("include") .help( - cstr!("Includes an additional module or local data file in the compiled executable. + cstr!("Includes an additional module or file/directory in the compiled executable. <p(245)>Use this flag if a dynamically imported module or a web worker main module - fails to load in the executable or to embed a file in the executable. This flag can - be passed multiple times, to include multiple additional modules.</>", + fails to load in the executable or to embed a file or directory in the executable. + This flag can be passed multiple times, to include multiple additional modules.</>", )) .action(ArgAction::Append) .value_hint(ValueHint::FilePath) 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() { |