Access relative `dist` path

Is there an easy way to get the relative path of an asset? How can I access the relative path of the /dist folder? App\\asset_path() returns the full uri. I have a case where I’m using file_get_contents to display inline SVGs and i need to provide the relative path, in my case '~/sitename/web/app/themes/ttg-theme/dist/images/svg/file.svg'.

Edit: Especially considering get_template_directory() now, returns the ‘resources’ folder, I can’t find an easy way to get the ‘dist’ folder.

Re-edit: This is my current code which requires the hardcoded theme path:

     * Create @svg() Blade directive
    sage('blade')->compiler()->directive('svg', function ($svg, $size = 'inherit') {
        return "<?= file_get_contents(get_theme_root() . '/theme-name/dist/images/svg/' . $svg . '.svg'); ?>";

What about

I’m running into this issue now. It’s not my first time using this function in a Sage9 theme so I’m not sure why I’m just now having this problem. Did you find a solution?

I’m going to look into some previous themes I developed to see what the difference is. Maybe that’ll lead to a solution that I can share.

I just ended up writing my own function and creating a new config entry to simplify things. I posted them in another thread: