You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// src/Illuminate/Foundation/Vite.phpprotectedfunctionmanifest($buildDirectory)
{
$path = $this->manifestPath($buildDirectory);
if (! isset(static::$manifests[$path])) {
if (! is_file($path)) {
thrownewViteManifestNotFoundException("Vite manifest not found at: $path");
}
static::$manifests[$path] = json_decode(file_get_contents($path), true);
}
returnstatic::$manifests[$path];
}
This json_decode(file_get_contents()) code can be replaced with the include() native php function. ( As its content had made with var_export(). ) include() and require() can use the opcache-preloading engine, especially efficient if the manifest.json file is on some slow/costly filesystems like NFS, AWS EFS etc.
I can write subclass or custom loader of Vite for me, but it will be incompatible on future versions of the framework.
How about adding any proper support to use cache ?
Thanks.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi.
I am creating a Laravel application with the Vite frontend.
I have found a potential code to improve performance around the Vite's
manifest.json
file.https://github.com/laravel/framework/blob/11.x/src/Illuminate/Foundation/Vite.php#L923
This
json_decode(file_get_contents())
code can be replaced with theinclude()
native php function. ( As its content had made withvar_export()
. )include()
andrequire()
can use the opcache-preloading engine, especially efficient if the manifest.json file is on some slow/costly filesystems like NFS, AWS EFS etc.I can write subclass or custom loader of Vite for me, but it will be incompatible on future versions of the framework.
How about adding any proper support to use cache ?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions