mirror of
https://github.com/coollabsio/coolify.git
synced 2026-09-24 07:25:13 -05:00
chore(setup): simplify inertia app entry point
This commit is contained in:
+3
-17
@@ -1,21 +1,7 @@
|
||||
import "../css/app.css";
|
||||
import type { Component } from "svelte";
|
||||
import { createInertiaApp } from "@inertiajs/svelte";
|
||||
import { resolvePageComponent } from "laravel-vite-plugin/inertia-helpers";
|
||||
import { mount } from "svelte";
|
||||
import Layout from "./layouts/Layout.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 });
|
||||
},
|
||||
defaults: {
|
||||
future: {
|
||||
preserveEqualProps: true,
|
||||
useDataInertiaHeadAttribute: true,
|
||||
useDialogForErrorModal: true,
|
||||
useScriptElementForInitialPage: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
layout: () => Layout,
|
||||
}).catch(console.error);
|
||||
|
||||
Reference in New Issue
Block a user