PluginProbe
WindPress – Tailwind CSS integration for WordPress / 3.2.87
WindPress – Tailwind CSS integration for WordPress v3.2.87
3.2.88 3.2.87 3.2.86 3.2.85 3.2.84 3.2.83 3.2.82 3.2.81 trunk 3.0.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.17 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 All 142 releases
windpress / src / Utils / Vite.php

Vite.php in WindPress – Tailwind CSS integration for WordPress 3.2.87, at src/Utils/Vite.php

47 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 * This file is part of the WindPress package.
5 *
6 * (c) Joshua Gugun Siagian <suabahasa@gmail.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11 declare (strict_types=1);
12 namespace WindPress\WindPress\Utils;
13
14 use WindPressDeps\Nabasa\VitePlus\Assets;
15 use WIND_PRESS;
16 final class Vite
17 {
18 private const SCOPE = 'windpress';
19 private static ?Assets $assets = null;
20 private function __construct()
21 {
22 }
23 public static function assets(): Assets
24 {
25 if (self::$assets === null) {
26 self::$assets = \WindPressDeps\Nabasa\VitePlus\assets(self::manifest_dir(), self::SCOPE);
27 }
28 return self::$assets;
29 }
30 public static function manifest(): object
31 {
32 return \WindPressDeps\Nabasa\VitePlus\get_manifest(self::manifest_dir(), self::SCOPE);
33 }
34 public static function manifest_dir(): string
35 {
36 return dirname(WIND_PRESS::FILE) . '/assets/dist';
37 }
38 public static function base_url(string $asset = ''): string
39 {
40 $url = self::assets()->url($asset);
41 if ($asset === '') {
42 return trailingslashit($url);
43 }
44 return $url;
45 }
46 }
47