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);