Skip to content

Commit

Permalink
✨ Add Vite support (#303)
Browse files Browse the repository at this point in the history
Co-authored-by: Brandon <[email protected]>
  • Loading branch information
czernika and Log1x authored Jan 5, 2024
1 parent 5e5a72f commit 2f1599b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Roots/Acorn/Assets/AssetsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public function register()
return new Manager($this->app->make('config')->get('assets'));
});

$this->app->singleton('assets.vite', Vite::class);

$this->app->singleton('assets.manifest', function ($app) {
return $app['assets']->manifest($this->getDefaultManifest());
});
Expand Down
20 changes: 20 additions & 0 deletions src/Roots/Acorn/Assets/Vite.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace Roots\Acorn\Assets;

use Illuminate\Foundation\Vite as FoundationVite;

class Vite extends FoundationVite
{
/**
* Generate an asset path for the application.
*
* @param string $path
* @param bool|null $secure
* @return string
*/
protected function assetPath($path, $secure = null)
{
return \Roots\asset($path)->uri();
}
}

0 comments on commit 2f1599b

Please sign in to comment.