1.0.29 • Published 2 months ago
@westacks/inertia-svelte v1.0.29
Inertia.js Svelte Adapter
Visit inertiajs.com to learn more.
Initialize app
// app.js
import { createInertiaApp } from '@westacks/inertia-svelte'
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'
import { hydrate } from 'svelte'
createInertiaApp({
resolve: name => resolvePageComponent(`./pages/${name}.svelte`, import.meta.glob('./pages/**/*.svelte')),
setup({ el, App, props }) {
hydrate(App, {target: el, props})
}
})
// ssr.js
import createServer from '@westacks/inertia-svelte/server'
import { createInertiaApp } from '@westacks/inertia-svelte'
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'
import { render } from 'svelte/server'
createServer(page => createInertiaApp({
page,
resolve: name => resolvePageComponent(`./pages/${name}.svelte`, import.meta.glob('./pages/**/*.svelte')),
setup: ({App, props}) => render(App, { props })
}))
1.0.29
2 months ago
2.0.0-next.3
2 months ago
1.0.28
2 months ago
1.0.27
2 months ago
1.0.26
3 months ago
2.0.0-next.2
3 months ago
2.0.0-next.1
3 months ago
1.0.25
3 months ago
1.0.24
3 months ago
1.0.23
3 months ago
1.0.22
3 months ago
1.0.21
3 months ago
1.0.20
4 months ago
1.0.19
4 months ago
1.0.18
4 months ago
1.0.17
4 months ago
1.0.1-6.1
4 months ago
1.0.16
4 months ago
1.0.15
5 months ago
1.0.14
5 months ago