chore(ui): add inertia app entry point

This commit is contained in:
peaklabs-dev 2026-03-04 17:15:42 +01:00
parent 612219efa9
commit 053628e2bf
No known key found for this signature in database
3 changed files with 24 additions and 16 deletions

View file

@ -0,0 +1,12 @@
import '../css/app.css'
import { createInertiaApp } from '@inertiajs/svelte'
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'
import { mount, type Component } from 'svelte'
createInertiaApp({
resolve: (name: string) => resolvePageComponent(`./pages/${name}.svelte`, import.meta.glob('./pages/**/*.svelte')),
setup({ el, App, props }: { el: HTMLElement; App: Component; props: Record<string, unknown> }) {
mount(App, { target: el, props })
}
})

View file

@ -1,16 +1,12 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="robots" content="noindex">
<title>Coolify</title>
@vite('resources/css/app.css')
</head>
<body>
<h1 class="text-3xl font-bold">Simple Heading</h1>
</body>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex">
@vite('resources/js/app.ts')
@inertiaHead
</head>
<body>
@inertia
</body>
</html>

View file

@ -6,7 +6,7 @@ import tailwindcss from '@tailwindcss/vite';
export default defineConfig({
plugins: [
laravel({
input: ['resources/js/app.js', 'resources/css/app.css'],
input: ['resources/js/app.ts'],
refresh: true,
}),
svelte({