Search code examples
server-side-renderinginertiajslaravel-11

Laravel 11 (inertia ssr, etc) remove PROD node dependency


I began to develop a Laravel 11 app with Jetstream, Tailwind, Inertia with SSR and Vue3 without taking into account I'd later need node on the webhosting to be able to run. But my hosting doesn't support node without changing to a more expensive VPS. So locally my app works perfect but not n my shared host.

I'm on versioning system so I'm not afraid to change. The question is: is it enough to deactivate SSR (how?) Which is my shortest path to remove node dependency in prod?

Thx in advance


Solution

  • For inertia and ssr to run on prod, apparently node is needed, but only if ssr is started. But you can run a laravel app in prod environment without starting ssr, it's just an option.

    If ssr is not started (via php artisan inertia:start-ssr) pages are parsed client-side and node is not needed (except for building the artifacts via npn run build)

    So if node is not available in prod, folders like bootstrap/ssr, public/build, node_modules have to be built localy and then copied manually to a prod server, which can run perfectly even if no node is available, as long as ssr isn't started.