File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed
Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change 1010 * The easiest way to build simple but powerful apps and APIs quickly.
1111 *
1212 * @author Michael Darko <[email protected] > 13- * @copyright 2019-2024 Michael Darko
13+ * @copyright 2019-2025 Michael Darko
1414 * @link https://leafphp.dev
1515 * @license MIT
1616 * @package Leaf
@@ -203,15 +203,18 @@ public function cors($options = [])
203203 /**
204204 * Tune vite to work without Leaf MVC
205205 */
206- public function vite ($ options = [
207- 'assets ' => '' ,
208- 'build ' => '' ,
209- 'hotFile ' => 'hot ' ,
210- ])
211- {
212- \Leaf \Vite::config ('assets ' , $ options ['assets ' ]);
213- \Leaf \Vite::config ('build ' , $ options ['build ' ]);
214- \Leaf \Vite::config ('hotFile ' , $ options ['hotFile ' ]);
206+ public function vite (
207+ $ options = [
208+ 'assets ' => '' ,
209+ 'build ' => '' ,
210+ 'hotFile ' => 'hot ' ,
211+ ]
212+ ) {
213+ if (class_exists ('Leaf\Vite ' )) {
214+ \Leaf \Vite::config ('assets ' , $ options ['assets ' ]);
215+ \Leaf \Vite::config ('build ' , $ options ['build ' ]);
216+ \Leaf \Vite::config ('hotFile ' , $ options ['hotFile ' ]);
217+ }
215218 }
216219
217220 /**
You can’t perform that action at this time.
0 commit comments