summaryrefslogtreecommitdiff
path: root/cli/tools/standalone.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools/standalone.rs')
-rw-r--r--cli/tools/standalone.rs17
1 files changed, 13 insertions, 4 deletions
diff --git a/cli/tools/standalone.rs b/cli/tools/standalone.rs
index f0f53d417..dcd2f5d43 100644
--- a/cli/tools/standalone.rs
+++ b/cli/tools/standalone.rs
@@ -41,6 +41,14 @@ pub async fn compile(
let ps = ProcState::build(flags).await?;
let module_specifier =
resolve_url_or_path(&compile_flags.source_file, ps.options.initial_cwd())?;
+ let module_roots = {
+ let mut vec = Vec::with_capacity(compile_flags.include.len() + 1);
+ vec.push(module_specifier.clone());
+ for side_module in &compile_flags.include {
+ vec.push(resolve_url_or_path(side_module, ps.options.initial_cwd())?);
+ }
+ vec
+ };
let deno_dir = &ps.dir;
let output_path = resolve_compile_executable_output_path(
@@ -49,10 +57,9 @@ pub async fn compile(
)
.await?;
- let graph = Arc::try_unwrap(
- create_graph_and_maybe_check(module_specifier.clone(), &ps).await?,
- )
- .unwrap();
+ let graph =
+ Arc::try_unwrap(create_graph_and_maybe_check(module_roots, &ps).await?)
+ .unwrap();
// at the moment, we don't support npm specifiers in deno_compile, so show an error
error_for_any_npm_specifier(&graph)?;
@@ -351,6 +358,7 @@ mod test {
output: Some(PathBuf::from("./file")),
args: Vec::new(),
target: Some("x86_64-unknown-linux-gnu".to_string()),
+ include: vec![],
},
&std::env::current_dir().unwrap(),
)
@@ -371,6 +379,7 @@ mod test {
output: Some(PathBuf::from("./file")),
args: Vec::new(),
target: Some("x86_64-pc-windows-msvc".to_string()),
+ include: vec![],
},
&std::env::current_dir().unwrap(),
)