|
@ -4,6 +4,7 @@ use Backend; |
|
|
use Cms\Classes\Theme; |
|
|
use Cms\Classes\Theme; |
|
|
use System\Classes\PluginBase; |
|
|
use System\Classes\PluginBase; |
|
|
use Wpstudio\AssetsManifest\Classes\Bundlers\Bundler; |
|
|
use Wpstudio\AssetsManifest\Classes\Bundlers\Bundler; |
|
|
|
|
|
use Wpstudio\AssetsManifest\Classes\Bundlers\ViteBundler; |
|
|
use Wpstudio\AssetsManifest\Classes\ManifestReader; |
|
|
use Wpstudio\AssetsManifest\Classes\ManifestReader; |
|
|
use Wpstudio\AssetsManifest\Classes\TwigFilters; |
|
|
use Wpstudio\AssetsManifest\Classes\TwigFilters; |
|
|
use Config; |
|
|
use Config; |
|
@ -37,6 +38,9 @@ class Plugin extends PluginBase |
|
|
{ |
|
|
{ |
|
|
app()->singleton(Bundler::class, Config::get('wpstudio.assetsmanifest::bundler')); |
|
|
app()->singleton(Bundler::class, Config::get('wpstudio.assetsmanifest::bundler')); |
|
|
|
|
|
|
|
|
|
|
|
if (Config::get('wpstudio.assetsmanifest::vite_dev_enabled') != ViteBundler::class || |
|
|
|
|
|
!Config::get('wpstudio.assetsmanifest::vite_dev_enabled') |
|
|
|
|
|
) { |
|
|
app()->singleton(ManifestReader::class, fn() => new ManifestReader( |
|
|
app()->singleton(ManifestReader::class, fn() => new ManifestReader( |
|
|
Theme::getActiveTheme()->getPath( |
|
|
Theme::getActiveTheme()->getPath( |
|
|
sprintf( |
|
|
sprintf( |
|
@ -47,6 +51,7 @@ class Plugin extends PluginBase |
|
|
), |
|
|
), |
|
|
)); |
|
|
)); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Boot method, called right before the request route. |
|
|
* Boot method, called right before the request route. |
|
|