package.json
:
{
"scripts": {
"dev": "vite",
"dev:server": "node public/build/server/server.js",
"build": "vite build",
"build:server": "vite build --outDir ./public/build/server --ssr ./resources/scripts/inertia/server.ts"
}
}
Main issue: in vite.php
you need to manually add the server.ts
to the entrypoints when you want to bundle for SSR using npm run build:server
Developing (in two separate terminals):
npm run dev
npm run dev:server
Didn't try the production build, but should be straightforward
Doesn't work.
TypeError: createServer is not a function