node_modules/grunt-angular-builder/tasks/middleware/buildAssets.js
/**
   * Scans a stylesheet for asset URL references and copies the assets to the build folder.
   * @private
   * @param {string} basePath
   * @param {string} targetPath
   * @param {string} sourceCode
   */
Scans a stylesheet for asset URL references and copies the assets to the build folder.
@private
@param {string} basePath
@param {string} targetPath
@param {string} sourceCode
Scans a stylesheet for asset URL references and copies the assets to the build folder . @private @param { string } basePath @param { string } targetPath @param { string } sourceCode
function scan (basePath, targetPath, sourceCode)
  {
    var match;
    while ((match = MATCH_URLS.exec (sourceCode))) {
      var url = match[2];
      if (!url.match (/^http/i) && url[0] !== '/') { 
        var absSrcPath = path.resolve (basePath, url)
          , absDestPath = path.resolve (targetPath, options.targetDir, url)
          , relDestPath = path.relative (targetPath, absDestPath);
        if (relDestPath[0] === '.')
          return util.warn ('Relative asset url falls outside the build folder: <cyan>%</cyan>%', url, util.NL);
        if (exportedAssets[absDestPath]) 
          continue;
        else exportedAssets[absDestPath] = true;
        var absTargetFolder = path.dirname (absDestPath);
        grunt.file.mkdir (absTargetFolder);
        if (options.symlink)
          fs.symlinkSync (absSrcPath, absDestPath);
        else grunt.file.copy (absSrcPath, absDestPath);
      }
    }
  }
function scan ( basePath , targetPath , sourceCode ) { var match ; while ( ( match = MATCH_URLS . exec ( sourceCode ) ) ) { var url = match [ 2 ] ; if ( ! url . match ( / ^http / i ) && url [ 0 ] !== '/' ) { var absSrcPath = path . resolve ( basePath , url ) , absDestPath = path . resolve ( targetPath , options . targetDir , url ) , relDestPath = path . relative ( targetPath , absDestPath ) ; if ( relDestPath [ 0 ] === '.' ) return util . warn ( 'Relative asset url falls outside the build folder: <cyan>%</cyan>%' , url , util . NL ) ; if ( exportedAssets [ absDestPath ] ) continue ; else exportedAssets [ absDestPath ] = true ; var absTargetFolder = path . dirname ( absDestPath ) ; grunt . file . mkdir ( absTargetFolder ) ; if ( options . symlink ) fs . symlinkSync ( absSrcPath , absDestPath ) ; else grunt . file . copy ( absSrcPath , absDestPath ) ; } } }
Scans a stylesheet for asset URL references and copies the assets to the build folder.
Scans a stylesheet for asset URL references and copies the assets to the build folder .
// Skip absolute URLs // skip already exported asset