summaryrefslogtreecommitdiff
path: root/cli/tools/bundle.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-01-24 14:23:19 +0100
committerGitHub <noreply@github.com>2023-01-24 08:23:19 -0500
commit654e177c919babe4eef4c1c9545ef267b23884e6 (patch)
tree7e8e00bef1afa9a062be9baf14fa9865865ec844 /cli/tools/bundle.rs
parent0d1471282bf758ed5f84e570bffa9424c7b8f26f (diff)
refactor(deno_graph): remove unused Resolved::Ok#kind usage (#17504)
See https://github.com/denoland/deno_graph/pull/205 for more details.
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
- }
+ )
}