code: function processPattern({ cwd = process.cwd(), ext } = {}) {
    let suffix = '/**';
  
    const extensions = (ext || ['html'])
      .map(_ext => (_ext.charAt(0) === '.' ? _ext.substr(1) : _ext));
  
    if (extensions.length === 1) {
      suffix = `${suffix}/*.${extensions[0]}`;
    } else {
      suffix = `${suffix}/*.{${extensions.join(',')}}`;
    }
  
    return function _processPattern(pattern) {
      const resolvedPath = path.resolve(cwd, pattern);
  
      if (!(fs.existsSync(resolvedPath) &&
            fs.statSync(resolvedPath).isDirectory())
      ) {
        return pattern;
      }
  
      return pattern.replace(/[\/\\]?$/, suffix);
    };
  }
docs: If the given pattern is a directory that exists, append `/** /*.ext` to match all files in the tree.