Skip to content

Commit

Permalink
[10.x] Make Vite throw a new ManifestNotFoundException (#47681)
Browse files Browse the repository at this point in the history
* refactor: introduce a new `ManifestNotFoundException` for Vite

* rename file

---------

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
innocenzi and taylorotwell authored Jul 8, 2023
1 parent 81bf9e7 commit 8eb6ae8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Foundation/Vite.php
Original file line number Diff line number Diff line change
Expand Up @@ -673,15 +673,15 @@ protected function assetPath($path, $secure = null)
* @param string $buildDirectory
* @return array
*
* @throws \Exception
* @throws \Illuminate\Foundation\ViteManifestNotFoundException
*/
protected function manifest($buildDirectory)
{
$path = $this->manifestPath($buildDirectory);

if (! isset(static::$manifests[$path])) {
if (! is_file($path)) {
throw new Exception("Vite manifest not found at: {$path}");
throw new ViteManifestNotFoundException("Vite manifest not found at: $path");
}

static::$manifests[$path] = json_decode(file_get_contents($path), true);
Expand Down
10 changes: 10 additions & 0 deletions src/Illuminate/Foundation/ViteManifestNotFoundException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Illuminate\Foundation;

use Exception;

class ViteManifestNotFoundException extends Exception
{
//
}

0 comments on commit 8eb6ae8

Please sign in to comment.