Skip to content

Commit

Permalink
[4.x] Add missing Vite content tag (#9973)
Browse files Browse the repository at this point in the history
Co-authored-by: jimblue <jimblue@users.noreply.github.com>
  • Loading branch information
jimblue and jimblue authored May 7, 2024
1 parent a7f97df commit f05bf09
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Tags/Vite.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,24 @@ public function asset()
->asset($src);
}

/**
* The {{ vite:content }} tag.
*
* @return string
*/
public function content()
{
if (! $src = $this->params->get('src')) {
throw new \Exception('Please provide a source file.');
}

$directory = $this->params->get('directory', 'build');

return $this->vite()
->useBuildDirectory($directory)
->content($src);
}

private function vite()
{
return clone app(LaravelVite::class);
Expand Down

0 comments on commit f05bf09

Please sign in to comment.