Skip to content

Commit

Permalink
feat(bundle): add --config flag (denoland#5130)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju committed May 7, 2020
1 parent 0ba90c8 commit 53265fb
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions cli/flags.rs
Expand Up @@ -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);

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -1925,6 +1927,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 =
Expand Down

0 comments on commit 53265fb

Please sign in to comment.