code: function supportRelativeURL(file, url) {
    if (!file) return url;
    var dir = path.dirname(file);
    var match = /^\w+:\/\/[^\/]*/.exec(dir);
    var protocol = match ? match[0] : '';
    var startPath = dir.slice(protocol.length);
    if (protocol && /^\/\w\:/.test(startPath)) {
      // handle file:///C:/ paths
      protocol += '/';
      return protocol + path.resolve(dir.slice(protocol.length), url).replace(/\\/g, '/');
    }
    return protocol + path.resolve(dir.slice(protocol.length), url);
  }
docs: Support URLs relative to a directory, but be careful about a protocol prefix in case we are in the browser (i.e. directories may start with "http://" or "file:///")