mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-04 10:44:04 +00:00
Replace custom Vite class override with Vite::createAssetPathsUsing() to ensure ViteBundler works for both container and static usage when asset_helper_override is enabled. Fixes #1388
28 lines
581 B
PHP
28 lines
581 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Stancl\Tenancy\Features;
|
|
|
|
use Illuminate\Foundation\Application;
|
|
use Illuminate\Support\Facades\Vite;
|
|
use Stancl\Tenancy\Contracts\Feature;
|
|
use Stancl\Tenancy\Tenancy;
|
|
|
|
class ViteBundler implements Feature
|
|
{
|
|
/** @var Application */
|
|
protected $app;
|
|
|
|
public function __construct(Application $app)
|
|
{
|
|
$this->app = $app;
|
|
}
|
|
|
|
public function bootstrap(Tenancy $tenancy): void
|
|
{
|
|
Vite::createAssetPathsUsing(function ($path, $secure = null) {
|
|
return global_asset($path);
|
|
});
|
|
}
|
|
}
|