startWatchingDirs(dirs) {
    const [head, ...tail] = dirs;

    if (head) this.stopWatchingDir(head);

    if (head && fs.existsSync(head)) {
      const watcher = fs.watch(
        head,
        { encoding: "utf8" },
        (eventType, filename) => {
          if (
            filename ===
            path.basename(this.project.config.contracts_build_directory)
          ) {
            this.startWatchingContracts();
          }

          if (tail[0] && filename === path.basename(tail[0]))
            this.startWatchingDirs(tail);
        },
      );
      this.dirWatchers[head] = watcher;
      this.startWatchingDirs(tail);
    } else {
      // When dirs === [], we assume that we are at the contracts_build_directory, so just start watching it
      this.startWatchingContracts();
    }
  }
@param {string[]} dirs An array of directory names