src/main.js
/**
   * Converts an inputed path to a URL based on:
   * - root paths
   * - output file path (urls are relative to this)
   * - /external/ prefix
   * - standard path normalization
   *
   * Leaves external URLs as-is.
   *
   * @param {string} origPath the path to convert to a normalized URL
   * @return {string} the normalized URL
   */
Converts an inputed path to a URL based on:
- root paths
- output file path (urls are relative to this)
- /external/ prefix
- standard path normalization

Leaves external URLs as-is.

@param {string} origPath the path to convert to a normalized URL
@return {string} the normalized URL
Converts an inputed path to a URL based on : - root paths - output file path ( urls are relative to this ) - / external / prefix - standard path normalization Leaves external URLs as - is . @param { string } origPath the path to convert to a normalized URL @return { string } the normalized URL
function toUrl(origPath) {
    let execPath = origPath;
    if (EXTERNAL_RE.test(origPath)) {
      return origPath;
    }
    const stamp = stamper(origPath);
    execPath = normalizePath(execPath);
    execPath = removeExternal(execPath);
    execPath = removeRootPath(execPath);
    execPath = relativeToHtml(execPath);
    execPath = normalizePath(execPath);
    execPath = stamp ? `${execPath}?v=${stamp}` : execPath;
    if (execPath !== origPath) {
      log("reduce: %s => %s", origPath, execPath);
    }
    return execPath;
  }
function toUrl ( origPath ) { let execPath = origPath ; if ( EXTERNAL_RE . test ( origPath ) ) { return origPath ; } const stamp = stamper ( origPath ) ; execPath = normalizePath ( execPath ) ; execPath = removeExternal ( execPath ) ; execPath = removeRootPath ( execPath ) ; execPath = relativeToHtml ( execPath ) ; execPath = normalizePath ( execPath ) ; execPath = stamp ? ` ${ execPath } ${ stamp } ` : execPath ; if ( execPath !== origPath ) { log ( "reduce: %s => %s" , origPath , execPath ) ; } return execPath ; }
Converts an inputed path to a URL based on:
 - root paths
 - output file path (urls are relative to this)
 - /external/ prefix
 - standard path normalization
Converts an inputed path to a URL based on : - root paths - output file path ( urls are relative to this ) - / external / prefix - standard path normalization
// Calculate the stamp on the origina fs-path