lib/plugins/FileSystemPlugin.js
function resolveURL (args) {
    var from = args.from;
    var to = args.to;
    var next = args.next;

    if (protocolPattern.test(from) || protocolPattern.test(to)) {
      // It's a URL, not a filesystem path, so let some other plugin resolve it
      return next();
    }

    if (from) {
      // The `from` path needs to be a directory, not a file. So, if the last character is NOT a
      // path separator, then we need to remove the filename from the path
      if (pathSeparators.indexOf(from[from.length - 1]) === -1) {
        from = path.dirname(from);
      }

      return path.resolve(from, to);
    }
    else {
      // Resolve the `to` path against the current working directory
      return path.resolve(to);
    }
  }
function resolveURL (args) {
    var from = args.from;
    var to = args.to;
    var next = args.next;

    if (protocolPattern.test(from) || protocolPattern.test(to)) {
      // It's a URL, not a filesystem path, so let some other plugin resolve it
      return next();
    }

    if (from) {
      // The `from` path needs to be a directory, not a file. So, if the last character is NOT a
      // path separator, then we need to remove the filename from the path
      if (pathSeparators.indexOf(from[from.length - 1]) === -1) {
        from = path.dirname(from);
      }

      return path.resolve(from, to);
    }
    else {
      // Resolve the `to` path against the current working directory
      return path.resolve(to);
    }
  }
function resolveURL ( args ) { var from = args . from ; var to = args . to ; var next = args . next ; if ( protocolPattern . test ( from ) || protocolPattern . test ( to ) ) { // It's a URL, not a filesystem path, so let some other plugin resolve it return next ( ) ; } if ( from ) { // The `from` path needs to be a directory, not a file. So, if the last character is NOT a // path separator, then we need to remove the filename from the path if ( pathSeparators . indexOf ( from [ from . length - 1 ] ) === - 1 ) { from = path . dirname ( from ) ; } return path . resolve ( from , to ) ; } else { // Resolve the `to` path against the current working directory return path . resolve ( to ) ; } }
Resolves a local filesystem path, relative to a base path.

@param {?string} args.from
The base path to resolve against. If unset, then the current working directory is used.

@param {string} args.to
The path to resolve. This may be absolute or relative. If relative, then it will be resolved
against {@link args.from}

@param {function} args.next
Calls the next plugin, if the path is not a filesystem path.

@returns {string|undefined}
Resolves a local filesystem path relative to a base path .