Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto enable SSR based on existence of SSR bundle #487

Merged
merged 3 commits into from
Jan 13, 2023
Merged

Conversation

reinink
Copy link
Member

@reinink reinink commented Jan 13, 2023

This PR removes the inertia.ssr.enabled config value in favor of automatically enabling SSR based on the existence of an SSR JavaScript bundle file.

By default it looks for the SSR bundle in a few common places, so quite often you won't even need to publish an Inertia config as long as you're using a pretty standard setup, such as bootstrap/ssr/ssr.mjs — the default location used by the Laravel Vite plugin.

You can, of course, still set a custom SSR bundle path using the inertia.ssr.bundle config option:

'ssr' => [

    'url' => 'http://127.0.0.1:13714',

    'bundle' => base_path('bootstrap/ssr/ssr.mjs'), // <!-- here

],

This PR also updates the inertia:start-ssr command to automatically terminate the node process should the PHP process die, as well as when the command is run, just in case there is a lingering node process hanging around still.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant