Get the resolved asset path

@param string $path
@param string $manifestDirectory

@return string
17378
public function getAssetPath(string $path, $manifestDirectory = '')
    {
        $this->setManifestDirectory($manifestDirectory);

        if ($this->isHotModuleReplacementEnabled()) {
            return $this->getHotModuleReplacementAssetPath($path);
        }

        return $this->getManifestAssetPath($path);
    }
104300
public function embed (string $assetPath) : string
    {
        return $this->fileLoader->loadFile(
            Asset::createFromAssetPath($assetPath),
            FileLoader::MODE_UNTOUCHED
        );
    }
998427
function resolvePath(filepath) {
  filepath = filepath.replace(RE_TRAILING, '');
  const cwd = process.cwd();
  const npmPackage = filepath.includes('node_modules');

  // Find nearest node_modules directory
  if (npmPackage) {
    const parts = filepath.split(path.sep);
    let idx = parts.lastIndexOf('node_modules');

    if (idx < parts.length - 1) idx += 2;
    // Handle scoped
    if (parts[idx - 1].charAt(0) == '@') idx++;

    const dir = parts.slice(0, idx).join(path.sep);

    // Installed packages must have manifest, otherwise continue
    if (exists(path.join(dir, 'package.json'))) return dir;
  }

  // Find nearest directory with node_modules subdirectory
  if (filepath.includes(cwd)) {
    let depth = maxFileSystemDepth;
    let dir = filepath;
    let parent = '';

    while (true) {
      parent = path.dirname(dir);
      // Stop if we hit max file system depth or root
      // Convert to lowercase to fix problems on Windows
      if (!--depth || parent.toLowerCase() === dir.toLowerCase()) {
        break;
      }

      // Stop at nearest directory with node_modules or cwd
      if (dir == cwd || exists(path.resolve(dir, 'node_modules'))) return dir;

      // Walk
      dir = parent;
    }
  }

  // Return project directory if file isn't a project file
  return cwd;
}
1272960
public function resolveArrayPath($path)
    {
        $path = explode('.', $this->escape($path));
        $root = $path[0];
        unset($path[0]);

        $arrayPath = '["'.implode('"]["', $path).'"]';

        $arrayBracket = '->';
        $arrayBracketEnd = '';

        if ($this->isArray()) {
            $arrayBracket = '["';
            $arrayBracketEnd = '"]';
        }

        return '$this->object'.$arrayBracket.$root.$arrayBracketEnd.$arrayPath;
    }
80260
def resolve(path, search_path, absolute=False):
    

    # Resolve external URLs
    if re.match(r'([a-z][a-z0-9+.\-]*:)?//', path, re.I):
        return path

    # Resolve static assets
    if path.startswith('@'):
        return utils.static_url(path[1:], absolute)

    path, sep, anchor = path.partition('#')

    # Resolve entries
    entry = utils.find_entry(path, search_path)
    if entry:
        return entry.permalink(absolute=absolute) + sep + anchor

    # Resolve images and assets
    img_path, img_args, _ = image.parse_image_spec(path)
    img = image.get_image(img_path, search_path)
    if not isinstance(img, image.ImageNotFound):
        path, _ = img.get_rendition(**img_args)
    return path + sep + anchor
199252
protected function resolveExtensionName($path)
    {
        preg_match("/src(.*?)src/", dirname($path), $match);
        if (!isset($match[1])) {
            throw new \Exception('Unable to resolve valid module path');
        }
        $name = trim($match[1], DIRECTORY_SEPARATOR);
        if (!starts_with($name, ['components', 'modules'])) {
            return false;
        }
        return str_replace('\\', '/', $name);
    }
905615
public static function get_asset_url($file)
    {
        if (static::$manifest === null) {
            static::parse_manifest();
        }

        // There was no manifest or no file present.
        if (static::$manifest === null || !isset(static::$manifest[ $file ])) {
            return get_stylesheet_directory_uri() . '/public' . $file;
        }

        return get_stylesheet_directory_uri() . '/public' . static::$manifest[ $file ];
    }
713790
protected function _getAbsoluteRemotePath($path = null)
    {
        if (null === $path) {
            return $this->_startingpath;
        }

        $path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
        if (null === $parse_url = @parse_url($path)) {
            $parse_url = array('path' => $path);
        }

        return ('/' === substr($parse_url['path'], 0, 1) ? $path : $this->_remotepath.'/'.$path);
    }
753043
private function resolveFilePath($path)
    {
        $path = str_replace(array($this->_protocol.'://', '/'), array('', DIRECTORY_SEPARATOR), $path);

        foreach ($this->_includeExtensions as $ext) {
            $filename = $path.$ext;
            File::resolveFilepath($filename, null, array('include_path' => $this->_classcontentdir));
            if (true === is_file($filename)) {
                return $filename;
            }
        }

        return $path;
    }
128958
protected function setManifestDirectory(string $manifestDirectory)
    {
        $this->manifest->directory = $manifestDirectory;
        $this->hotModuleReplacement->directory = $manifestDirectory;    
    }
63973
public function getEngineFromPath($path)
    {
        $extension = $this->getExtension($path);

        $engine = $this->extensions[$extension];

        return $this->engines->resolve($engine);
    }
1368328
public function resolveResourcePath($path)
    {
        $matches = [];
        preg_match('/@(\w+)/', $path, $matches);
        if (isset($matches[0], $matches[1])) {
            if (false === isset($this->bundle_paths[$matches[1]])) {
                return false;
            }
            $template = realpath(
                str_replace(
                    $matches[0],
                    $this->bundle_paths[$matches[1]] . DIRECTORY_SEPARATOR . trim($this->asset_dir, "\\/"),
                    $path
                )
            );
            return $template;
        }

        return $path;
    }
320523
public function resolveFullPath($path)
    {
        if (is_array($path)) {
            $paths  = array();
            foreach ($path as $p) {
                $paths[]    = $this->resolveFullPath($p);
            }
            return $paths;
        } else {
            if (strpos($path, $this->getRepositoryPath()) === 0) {
                return $path;
            }
            $path  = FileSystem::normalizeDirectorySeparator($path);
            $path  = ltrim($path, '/');
            return $this->getRepositoryPath().'/'.$path;
        }
    }
515445
public function asset_path($path)
	{
		if ($this->active['path'] === null)
		{
			throw new \ThemeException('You must set an active theme.');
		}

		if ($this->active['asset_base'])
		{
			return $this->active['asset_base'].$path;
		}
		else
		{
			return $this->active['path'].$path;
		}
	}
1083526
public static function resolveUrl(AssetInterface $asset, $url)
    {
        // given URL is absolute URL
        if (false !== strpos($url, '://')) {
            return $url;
        }

        // source directory of the asset
        $root = dirname($asset->getSourceRoot().'/'.$asset->getTargetPath());

        // path directory where asset is being copied
        $path = dirname($asset->getTargetPath());

        if ('.' === $path) {
            $image = $url;
        } else {
            $image = $path.'/'.$url;
        }

        if (null !== $root) {
            $image = $root.'/'.$url;
        }

        // cleanup local URLs
        if (false === strpos($image, '://')) {
            $image = self::removeQueryString($image);
            $image = self::removeAnchor($image);

            return self::resolveUps($image);
        }

        return $image;
    }
852869
protected function resolveFilePaths($paths)
    {
        $loadedPlugins = Plugin::loaded();

        return array_map(function ($path) use ($loadedPlugins) {
            $pluginSplit = pluginSplit($path);

            //Note that using `pluginSplit()` is not sufficient, because
            //  `$path` may still contain a dot
            if (!empty($pluginSplit[0]) && in_array($pluginSplit[0], $loadedPlugins)) {
                list($plugin, $path) = $pluginSplit;
            }

            $path = string_starts_with($path, '/') ? substr($path, 1) : $this->type . DS . $path;
            $path = DS === '/' ? $path : $path = str_replace('/', DS, $path);
            $path = empty($plugin) ? WWW_ROOT . $path : Plugin::path($plugin) . 'webroot' . DS . $path;

            //Appends the file extension, if not already present
            $path = pathinfo($path, PATHINFO_EXTENSION) == $this->type ? $path : sprintf('%s.%s', $path, $this->type);
            is_readable_or_fail($path);

            return $path;
        }, (array)$paths);
    }
942166
private function getComponentManifest($manifestPath, $componentId)
    {
        $manifest = $this->getManifest($manifestPath);
        $index = $this->getManifestComponentModuleIndex($manifest, $componentId);

        return $manifest['modules'][$index];
    }