fix: support watch flag to enable watching other files than the main module on serve subcommand (#26622)

Closes #26618
This commit is contained in:
HasanAlrimawi 2024-10-29 23:55:41 +02:00 committed by GitHub
parent a69224ea5b
commit 3b28446000
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 74 additions and 0 deletions

View file

@ -1672,6 +1672,10 @@ impl CliOptions {
if let DenoSubcommand::Run(RunFlags {
watch: Some(WatchFlagsWithPaths { paths, .. }),
..
})
| DenoSubcommand::Serve(ServeFlags {
watch: Some(WatchFlagsWithPaths { paths, .. }),
..
}) = &self.flags.subcommand
{
full_paths.extend(paths.iter().map(|path| self.initial_cwd.join(path)));