Module->getResource->getRelativePath returns path in vendor - not resources folder

**Silverstripe 4.1

Question:
I want to get the path to a modules image resource folder. When I do - the path returned is in the vendor folder rather than the resources folder.

// get the path to one of the images
$var["imagePath"] = ModuleLoader::getModule('milessummers/silverstripe-rateable')->getResource('images/star-off.png')->getRelativePath();
// get the path only
$var["imagePath"] = dirname($var["imagePath"]) . '/';
// I don't know why but I need to do this as the path is in vendor folder
$var["imagePath"] = str_replace ( 'vendor' , 'resources' , $var["imagePath"]);

What do you mean by path? The path is usually a filesystem path, thus it’s correct that it contains the vendor folder. If you need the exposed asset url, use ->getResource('images/star-off.png')->getURL(); instead.

I need the exposed asset filesystem path relative to the root of the site