init commit
This commit is contained in:
commit
c9d982669a
461 changed files with 30317 additions and 0 deletions
18
resources/js/app.ts
Normal file
18
resources/js/app.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { createInertiaApp, type ResolvedComponent } from '@inertiajs/svelte';
|
||||
import { hydrate, mount } from 'svelte';
|
||||
import '../css/app.css';
|
||||
import './bootstrap';
|
||||
|
||||
createInertiaApp({
|
||||
resolve: (name: string) => {
|
||||
const pages = import.meta.glob<ResolvedComponent>('./pages/**/*.svelte', { eager: true });
|
||||
return pages[`./pages/${name}.svelte`];
|
||||
},
|
||||
setup({ el, App, props }) {
|
||||
if (el && el.dataset.serverRendered === 'true') {
|
||||
hydrate(App, { target: el, props });
|
||||
} else if (el) {
|
||||
mount(App, { target: el, props });
|
||||
}
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue