LiveSvelte.SSR.ViteJS (LiveSvelte v0.18.0)

Copy Markdown View Source

Implements SSR by making a POST request to http://{:vite_host}/ssr_render.

ssr_render is implemented as a Vite plugin. Add it to the vite.config.js plugins section:

import liveSveltePlugin from "live_svelte/vitePlugin"

export default {
  plugins: [liveSveltePlugin()],
  // ...
}

Configuration

In config/dev.exs:

config :live_svelte, ssr_module: LiveSvelte.SSR.ViteJS
config :live_svelte, vite_host: "http://localhost:5173"

Summary

Functions

Returns a path relative to the configured Vite JS host.

Functions

render(name, props, slots)

Callback implementation for LiveSvelte.SSR.render/3.

vite_path(path)

Returns a path relative to the configured Vite JS host.