initial commit
This commit is contained in:
commit
2e0cbc254c
174 changed files with 27742 additions and 0 deletions
22
resources/js/ssr.tsx
Normal file
22
resources/js/ssr.tsx
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { createInertiaApp } from '@inertiajs/react';
|
||||
import createServer from '@inertiajs/react/server';
|
||||
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
|
||||
import ReactDOMServer from 'react-dom/server';
|
||||
|
||||
const appName = import.meta.env.VITE_APP_NAME || 'Laravel';
|
||||
|
||||
createServer((page) =>
|
||||
createInertiaApp({
|
||||
page,
|
||||
render: ReactDOMServer.renderToString,
|
||||
title: (title) => (title ? `${title} - ${appName}` : appName),
|
||||
resolve: (name) =>
|
||||
resolvePageComponent(
|
||||
`./pages/${name}.tsx`,
|
||||
import.meta.glob('./pages/**/*.tsx'),
|
||||
),
|
||||
setup: ({ App, props }) => {
|
||||
return <App {...props} />;
|
||||
},
|
||||
}),
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue