Skip to content

Commit

Permalink
Fixed url of vite resources in cases with and without base_url.
Browse files Browse the repository at this point in the history
  • Loading branch information
adiwidjaja committed Sep 20, 2024
1 parent 845615f commit e9caf8d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Helper/ViteHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use SilverStripe\ORM\FieldType\DBField;
use SilverStripe\View\TemplateGlobalProvider;
use SilverStripe\View\ViewableData;
use SilverStripe\Control\Director;

class ViteHelper extends ViewableData implements TemplateGlobalProvider
{
Expand Down Expand Up @@ -85,7 +86,7 @@ public static function Vite($path, int $getCSSFile = null): string
} else {
$path = $outputUrl . $manifest[$path]['file'];
}
return Convert::raw2att("/{$path}");
return Convert::raw2att(Director::absoluteURL($path));
}
}

Expand Down

0 comments on commit e9caf8d

Please sign in to comment.