File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
src/Illuminate/Foundation Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1023,4 +1023,14 @@ public function toHtml()
1023
1023
{
1024
1024
return $ this ->__invoke ($ this ->entryPoints )->toHtml ();
1025
1025
}
1026
+
1027
+ /**
1028
+ * Flush state.
1029
+ *
1030
+ * @return void
1031
+ */
1032
+ public function flush ()
1033
+ {
1034
+ $ this ->preloadedAssets = [];
1035
+ }
1026
1036
}
Original file line number Diff line number Diff line change @@ -1693,6 +1693,18 @@ public function testItCanConfigureThePrefetchTriggerEvent()
1693
1693
$ this ->cleanViteManifest ($ buildDir );
1694
1694
}
1695
1695
1696
+ public function testItCanFlushState ()
1697
+ {
1698
+ $ this ->makeViteManifest ();
1699
+
1700
+ app (Vite::class)('resources/js/app.js ' );
1701
+ app ()->forgetScopedInstances ();
1702
+ $ this ->assertCount (1 , app (Vite::class)->preloadedAssets ());
1703
+
1704
+ app (Vite::class)->flush ();
1705
+ $ this ->assertCount (0 , app (Vite::class)->preloadedAssets ());
1706
+ }
1707
+
1696
1708
protected function cleanViteManifest ($ path = 'build ' )
1697
1709
{
1698
1710
if (file_exists (public_path ("{$ path }/manifest.json " ))) {
You can’t perform that action at this time.
0 commit comments