Skip to content

Commit 7bff823

Browse files
authored
Clear resolved Vite instance (via Facade) to avoid memory-leak (#993)
fixes #992 Signed-off-by: Mior Muhammad Zaki <[email protected]>
1 parent aaa2f46 commit 7bff823

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/Concerns/ProvidesDefaultConfigurationOptions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public static function prepareApplicationForNextOperation(): array
5959
\Laravel\Octane\Listeners\PrepareLivewireForNextOperation::class,
6060
\Laravel\Octane\Listeners\PrepareScoutForNextOperation::class,
6161
\Laravel\Octane\Listeners\PrepareSocialiteForNextOperation::class,
62+
\Laravel\Octane\Listeners\PrepareViteForNextOperation::class,
6263
];
6364
}
6465

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace Laravel\Octane\Listeners;
4+
5+
use Illuminate\Foundation\Vite;
6+
use Illuminate\Support\Facades\Facade;
7+
8+
class PrepareViteForNextOperation
9+
{
10+
/**
11+
* Handle the event.
12+
*
13+
* @param mixed $event
14+
*/
15+
public function handle($event): void
16+
{
17+
Facade::clearResolvedInstance(Vite::class);
18+
}
19+
}

0 commit comments

Comments
 (0)