From ebe0b8b3192eef0980ee55b6a75e6f76c7a6eb28 Mon Sep 17 00:00:00 2001 From: jimblue Date: Tue, 30 Apr 2024 14:14:22 +0200 Subject: [PATCH] Add missing Vite content tag (#9972) --- 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);