Add inertia:start-ssr
and inertia:stop-ssr
artisan commands
#483
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds two new Inertia artisan commands for starting and stopping the Inertia SSR server:
The goal here is to simplify the SSR setup, removing the need to add these commands to your
package.json
scripts.This update includes a new
inertia.ssr.bundle
config option. This is the path to your local Inertia SSR bundle. By default it's set tobase_path('bootstrap/ssr/ssr.mjs')
, which is where the Laravel Vite plugin puts it, but you can change it to another location if needed. For example, if you're using webpack it might be located atpublic_path('js/ssr.js')
.As part of this update I also changed the
inertia.ssr.url
config value to not require the/render
endpoint as part of the URL, as I'm now using this URL for both rendering and shutting down. I've made this change in a backwards compatible way — meaning if your config still includes/render
in the URL, we automatically strip it out.