Skip to content

Commit

Permalink
Fix asset paths for non-root project setups (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
vzambon authored Dec 22, 2024
1 parent d748b2b commit c611738
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ function translationsUIAssets(): HtmlString

$manifest = json_decode(file_get_contents($manifestPath), true);

$file = asset("/vendor/translations-ui/{$manifest['resources/scripts/app.ts']['file']}");
$css = asset("/vendor/translations-ui/{$manifest['resources/scripts/app.ts']['css'][0]}");

return new HtmlString(<<<HTML
<script type="module" src="/vendor/translations-ui/{$manifest['resources/scripts/app.ts']['file']}"></script>
<link rel="stylesheet" href="/vendor/translations-ui/{$manifest['resources/scripts/app.ts']['css'][0]}">
<script type="module" src="{$file}"></script>
<link rel="stylesheet" href="{$css}">
HTML
);
}
Expand Down

0 comments on commit c611738

Please sign in to comment.