summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-05-07 17:02:03 +0200
committerGitHub <noreply@github.com>2020-05-07 17:02:03 +0200
commit53265fb6dbe1d1676d68b7060ba33e4ba79b9144 (patch)
tree5e40808b9a1849c89dbce77b89ddc6c8c5a005e4
parent0ba90c8c11089500b23761f126a8d08afd38a73e (diff)
feat(bundle): add --config flag (#5130)
-rw-r--r--cli/flags.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/cli/flags.rs b/cli/flags.rs
index f87c338c4..bb81f0d01 100644
--- a/cli/flags.rs
+++ b/cli/flags.rs
@@ -367,6 +367,7 @@ fn install_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
fn bundle_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
ca_file_arg_parse(flags, matches);
+ config_arg_parse(flags, matches);
importmap_arg_parse(flags, matches);
unstable_arg_parse(flags, matches);
@@ -698,6 +699,7 @@ fn bundle_subcommand<'a, 'b>() -> App<'a, 'b> {
.arg(ca_file_arg())
.arg(importmap_arg())
.arg(unstable_arg())
+ .arg(config_arg())
.about("Bundle module and dependencies into single file")
.long_about(
"Output a single JavaScript file with all dependencies.
@@ -1926,6 +1928,30 @@ mod tests {
}
#[test]
+ fn bundle_with_config() {
+ let r = flags_from_vec_safe(svec![
+ "deno",
+ "bundle",
+ "--config",
+ "tsconfig.json",
+ "source.ts",
+ "bundle.js"
+ ]);
+ assert_eq!(
+ r.unwrap(),
+ Flags {
+ subcommand: DenoSubcommand::Bundle {
+ source_file: "source.ts".to_string(),
+ out_file: Some(PathBuf::from("bundle.js")),
+ },
+ allow_write: true,
+ config_path: Some("tsconfig.json".to_owned()),
+ ..Flags::default()
+ }
+ );
+ }
+
+ #[test]
fn bundle_with_output() {
let r =
flags_from_vec_safe(svec!["deno", "bundle", "source.ts", "bundle.js"]);