From f05bf097548456d83a582a9ea7cc23a74a532538 Mon Sep 17 00:00:00 2001 From: Jim Blue <10623367+jimblue@users.noreply.github.com> Date: Wed, 8 May 2024 00:06:04 +0200 Subject: [PATCH] [4.x] Add missing Vite content tag (#9973) Co-authored-by: jimblue --- src/Tags/Vite.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/Tags/Vite.php b/src/Tags/Vite.php index 2e738913d8..0a7c09f5a1 100644 --- a/src/Tags/Vite.php +++ b/src/Tags/Vite.php @@ -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);