Vite
final class Vite
Supports operations for Vite.
Methods
static string
csrfToken()
Extracts value of csrf_token from hidden element.
static bool
isDev()
Simple env-based dev check.
static bool
viteIsRunning(string $devBase = 'http://localhost:5173')
Check if Vite dev server is reachable.
static string
devTags(string $entry, string $devServer)
Adds dev tags.
static array|null
loadManifest()
Locate and decode the Vite manifest.
static string
prodTags(string $entry)
Adds production tags.
static string
tags(string $entry, string $devServer = 'http://localhost:5173')
Render script/link tags for a Vite entry.
Details
at line 16
static string
csrfToken()
Extracts value of csrf_token from hidden element.
at line 30
static bool
isDev()
Simple env-based dev check.
at line 41
static bool
viteIsRunning(string $devBase = 'http://localhost:5173')
Check if Vite dev server is reachable.
at line 56
static private string
devTags(string $entry, string $devServer)
Adds dev tags.
at line 72
static private array|null
loadManifest()
Locate and decode the Vite manifest.
at line 109
static private string
prodTags(string $entry)
Adds production tags.
at line 177
static string
tags(string $entry, string $devServer = 'http://localhost:5173')
Render script/link tags for a Vite entry.
- In dev (env=local/dev & dev server up), inject HMR client + raw module URL.
- In prod (APP_ENV=production), always use manifest-based assets.