summaryrefslogtreecommitdiff
path: root/cli/tools/bundle.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools/bundle.rs')
-rw-r--r--cli/tools/bundle.rs23
1 files changed, 3 insertions, 20 deletions
diff --git a/cli/tools/bundle.rs b/cli/tools/bundle.rs
index ac17684e2..437bad1d4 100644
--- a/cli/tools/bundle.rs
+++ b/cli/tools/bundle.rs
@@ -134,7 +134,7 @@ fn bundle_module_graph(
graph: &deno_graph::ModuleGraph,
ps: &ProcState,
) -> Result<deno_emit::BundleEmit, AnyError> {
- log::info!("{} {}", colors::green("Bundle"), graph.roots[0].0);
+ log::info!("{} {}", colors::green("Bundle"), graph.roots[0]);
let ts_config_result = ps
.options
@@ -145,29 +145,12 @@ fn bundle_module_graph(
}
}
- let mut output = deno_emit::bundle_graph(
+ deno_emit::bundle_graph(
graph,
deno_emit::BundleOptions {
bundle_type: deno_emit::BundleType::Module,
emit_options: ts_config_result.ts_config.into(),
emit_ignore_directives: true,
},
- )?;
-
- // todo(https://github.com/denoland/deno_emit/issues/85): move to deno_emit
- if let Some(shebang) = shebang_file(graph) {
- output.code = format!("{}\n{}", shebang, output.code);
- }
-
- Ok(output)
-}
-
-fn shebang_file(graph: &deno_graph::ModuleGraph) -> Option<String> {
- let source = graph.get(&graph.roots[0].0)?.maybe_source.as_ref()?;
- let first_line = source.lines().next()?;
- if first_line.starts_with("#!") {
- Some(first_line.to_string())
- } else {
- None
- }
+ )
}