Skip to content
This repository has been archived by the owner on Oct 18, 2022. It is now read-only.

WIP: an attempt to create a lightweight and flexible SSR solution for Svelte using vite-plugin-ssr.

Notifications You must be signed in to change notification settings

aral/vite-plugin-ssr-svelte

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WIP: Svelte SSR example using vite-plugin-ssr

An attempt to create a Svelte version of the vite-plugin-ssr vue template.

Vite plugins used

Outstanding issues

  • Cheat: “layout” is being manually imported into all pages.

    In the Vue example, it’s trivial to implement a layout template but Svelte pages must be compiled. You could add that feature to this example by manually creating and rendering a Svelte page wrapped in the layout component but that would add a lot of complexity to this small example while still not being indicative of real-world use (where you could have a hierarchy of layout templates and would likely have to keep a graph of your dependencies).

    Relatedly, instead of local scoped styles, we’re scoping the styles to the content of the slot in the “Colored page” using the new * :global() syntax in Svelte.

  • Cheat: logo.svg link hardcoded in head (in default.page.server.js)

Install and run

  1. Clone this repository
  2. Install dependencies: npm i
  3. Run it: npm run dev
  4. Hit https://localhost in your browser.

About

WIP: an attempt to create a lightweight and flexible SSR solution for Svelte using vite-plugin-ssr.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published