code: function (dir, filelist, ext, currentBundleOptions) {
      var path = path || require('path');
      var fs = fs || require('fs');
      var files = fs.readdirSync(dir);
      filelist = filelist || [];
      files.forEach(function (file) {
          if (fs.statSync(path.join(dir, file)).isDirectory()) {
              filelist = walkSync(path.join(dir, file), filelist, ext, currentBundleOptions);
          }
          else {
              if (file.match(new RegExp("." + ext + "$")) && !isExcluded(file, currentBundleOptions))
                  filelist.push(path.join(dir, file));
          }
      });
      return filelist;
  }
docs: List all files in a directory in Node.js recursively in a synchronous fashion