mirror of
https://github.com/denoland/deno.git
synced 2024-12-27 09:39:08 -05:00
feat(bundle): add support for --reload flag (#6996)
This commit is contained in:
parent
f5a4f1fdc0
commit
c4edd09816
1 changed files with 19 additions and 0 deletions
19
cli/flags.rs
19
cli/flags.rs
|
@ -394,6 +394,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);
|
||||
reload_arg_parse(flags, matches);
|
||||
importmap_arg_parse(flags, matches);
|
||||
unstable_arg_parse(flags, matches);
|
||||
lock_args_parse(flags, matches);
|
||||
|
@ -771,6 +772,7 @@ fn bundle_subcommand<'a, 'b>() -> App<'a, 'b> {
|
|||
)
|
||||
.arg(Arg::with_name("out_file").takes_value(true).required(false))
|
||||
.arg(ca_file_arg())
|
||||
.arg(reload_arg())
|
||||
.arg(importmap_arg())
|
||||
.arg(unstable_arg())
|
||||
.arg(config_arg())
|
||||
|
@ -2276,6 +2278,23 @@ mod tests {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bundle_with_reload() {
|
||||
let r =
|
||||
flags_from_vec_safe(svec!["deno", "bundle", "--reload", "source.ts"]);
|
||||
assert_eq!(
|
||||
r.unwrap(),
|
||||
Flags {
|
||||
reload: true,
|
||||
subcommand: DenoSubcommand::Bundle {
|
||||
source_file: "source.ts".to_string(),
|
||||
out_file: None,
|
||||
},
|
||||
..Flags::default()
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn run_importmap() {
|
||||
let r = flags_from_vec_safe(svec![
|
||||
|
|
Loading…
Reference in a new issue