Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"private": true,
"type": "module",
"scripts": {
"build": "vite build",
"build:ssr": "vite build && vite build --ssr",
"build": "vite build && vite build --ssr",
"dev": "vite",
"format": "prettier --write resources/",
"format:check": "prettier --check resources/",
Expand Down Expand Up @@ -46,7 +45,10 @@
"ignoredBuiltDependencies": [
"esbuild",
"vue-demi"
]
],
"patchedDependencies": {
"@nuxt/ui": "patches/@nuxt__ui.patch"
}
},
"packageManager": "pnpm@10.18.3"
}
13 changes: 13 additions & 0 deletions patches/@nuxt__ui.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/dist/runtime/inertia/stubs.js b/dist/runtime/inertia/stubs.js
index ace46882188bf6d205b6038fa07eea6608b534e3..6318f8599fb972a9f9f645c1ab07c279e1d1fd70 100644
--- a/dist/runtime/inertia/stubs.js
+++ b/dist/runtime/inertia/stubs.js
@@ -65,7 +65,7 @@ const hooks = createHooks();
export function useNuxtApp() {
return {
isHydrating: true,
- payload: { serverRendered: false },
+ payload: { serverRendered: import.meta.env.SSR },
hooks,
hook: hooks.hook
};
9 changes: 7 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion resources/js/ssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { renderToString } from '@vue/server-renderer'
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'
import { createSSRApp, DefineComponent, h } from 'vue'
import { Config, route as ziggyRoute } from 'ziggy-js'
import ui from '@nuxt/ui/vue-plugin'

const appName = import.meta.env.VITE_APP_NAME || 'Laravel Starter Template'

Expand Down Expand Up @@ -40,7 +41,9 @@ createServer((page) =>
global.route = route
}

app.use(plugin)
app
.use(plugin)
.use(ui)

return app
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<link href="https://fonts.bunny.net/css?family=instrument-sans:400,500,600" rel="stylesheet" />

@routes
@vite(['resources/js/app.ts', "resources/js/pages/{$page['component']}.vue"])
@vite(['resources/js/app.ts', 'resources/css/app.css', "resources/js/pages/{$page['component']}.vue"])
@inertiaHead
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
laravel({
input: ['resources/js/app.ts'],
input: ['resources/js/app.ts', 'resources/css/app.css',],
ssr: 'resources/js/ssr.ts',
refresh: true,
}),
Expand Down