-
-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto enable SSR based on existence of SSR bundle (#487)
* Auto enable SSR based on existence of SSR bundle * Terminate SSR node process when PHP process dies * Add missing comma
- Loading branch information
Showing
4 changed files
with
47 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Inertia\Ssr; | ||
|
||
class BundleDetector | ||
{ | ||
public function detect() | ||
{ | ||
return collect([ | ||
config('inertia.ssr.bundle'), | ||
base_path('bootstrap/ssr/ssr.mjs'), | ||
base_path('bootstrap/ssr/ssr.js'), | ||
public_path('js/ssr.js'), | ||
])->filter()->first(function ($path) { | ||
return file_exists($path); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters