Skip to content

Commit bc40eca

Browse files
committed
chore(resources): update
1 parent dba9d50 commit bc40eca

File tree

3 files changed

+12
-22
lines changed

3 files changed

+12
-22
lines changed

resources/css/app.css

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,4 @@
1414
--color-scarlet-700: #b11d00;
1515
--color-scarlet-800: #8e1a00;
1616
--color-scarlet-950: #4a0d00;
17-
}
18-
19-
.dark {
20-
--ui-primary: var(--ui-color-primary-500);
21-
}
17+
}

resources/js/app.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,6 @@ import type { DefineComponent } from 'vue'
77
import { createApp, h } from 'vue'
88
import { ZiggyVue } from 'ziggy-js'
99

10-
// Extend ImportMeta interface for Vite...
11-
declare module 'vite/client' {
12-
interface ImportMetaEnv {
13-
readonly VITE_APP_NAME: string
14-
[key: string]: string | boolean | undefined
15-
}
16-
17-
interface ImportMeta {
18-
readonly env: ImportMetaEnv
19-
readonly glob: <T>(pattern: string) => Record<string, () => Promise<T>>
20-
}
21-
}
22-
2310
const appName = import.meta.env.VITE_APP_NAME || 'Laravel Starter Template'
2411

2512
createInertiaApp({

resources/js/ssr.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import createServer from '@inertiajs/vue3/server'
33
import { renderToString } from '@vue/server-renderer'
44
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'
55
import { createSSRApp, DefineComponent, h } from 'vue'
6-
import { route as ziggyRoute } from 'ziggy-js'
6+
import { route as ziggyRoute, Config } from 'ziggy-js'
77

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

@@ -18,18 +18,25 @@ createServer((page) =>
1818

1919
// Configure Ziggy for SSR...
2020
const ziggyConfig = {
21-
...page.props.ziggy,
22-
location: new URL(page.props.ziggy.location)
21+
...(page.props.ziggy as Config),
22+
location: new URL((page.props.ziggy as { location: string }).location)
2323
}
2424

2525
// Create route function...
26-
const route = (name: string, params?: any, absolute?: boolean) => ziggyRoute(name, params, absolute, ziggyConfig)
26+
const route = ((name?: string, params?: any, absolute?: boolean) => {
27+
if (!name) return ziggyRoute(undefined, undefined, absolute, ziggyConfig)
28+
return ziggyRoute(name, params, absolute, ziggyConfig)
29+
}) as {
30+
(): any;
31+
(name: string, params?: any, absolute?: boolean): string;
32+
}
2733

2834
// Make route function available globally...
2935
app.config.globalProperties.route = route
3036

3137
// Make route function available globally for SSR...
3238
if (typeof window === 'undefined') {
39+
// @ts-expect-error - This is a global variable
3340
global.route = route
3441
}
3542

0 commit comments

Comments
 (0)