code: function localizePaths(pathList) {
    // resolve paths so that './foo/bar.js' and 'foo/bar.js' resolve to the same localized path
    pathList = pathList.map(function (p) {
      var resolvedPath = path.resolve(p);
      if (resolvedPath.substr(resolvedPath.length - 3) === '.js') {
        resolvedPath = resolvedPath.substr(0, resolvedPath.length - 3);
      }
      return resolvedPath;
    });
  
    var localizedPathList = [];
    if (pathList.length > 0) {
      var commonPath = null;
      pathList.forEach(function (fullPath, i) {
        var parts;
        if (commonPath === null) {
          parts = fullPath.split('/');
          if (parts.length > 1) {
            commonPath = parts.slice(0, parts.length - 1).join('/') + '/';
          } else {
            commonPath = '';
          }
        } else if (commonPath.length > 0) {
          parts = commonPath.split('/');
          parts.pop();
          commonPath = '';
          for (var partIndex = 0; partIndex < parts.length; partIndex++) {
            var testPath = commonPath + parts[partIndex] + '/';
            if (fullPath.substring(0, testPath.length) === testPath) {
              commonPath = testPath;
            } else {
              break;
            }
          }
        }
      });
      pathList.forEach(function (fullPath, i) {
        localizedPathList.push(fullPath.substr(commonPath.length));
      });
    }
    return localizedPathList;
  }
docs: /*
  Compress absolute paths down to minimal non-colliding lengths.
  @param {Array} pathList List of absolute paths.