A Svelte version of the vite-plugin-ssr module.
This module demonstrates doing fully prerendered HTML with the correct hydration settings so that your app will load smoothly in any context.
You can try it out here: https://ryanweal.github.io/vite-plugin-ssr-svelte/
Why not use SvelteKit? Using vite-plugin-ssr
you can override pretty much
everything and you could also add other frameworks (such as Vue, React,
others) for specific routes by providing more specific page.client.js
and
page.server.js
files.
This repo could be used as a starter for your next project. It is setup to do the typical framework tasks:
We also include some examples of making API calls on the server-side only to fetch your data.
npm i
npm run dev
and enjoy hot reloading as you work.http://localhost:3000
in your browser.npm run build
npx serve dist/client
To update this package you can follow the normal NPM update procedures.
We have used the built-in npm shrinkwrap
command to provide an
npm-shrinkwrap.json
rather than the normal package-lock.json
which keeps
this repo fixed at a "known good" state, if you use npm
as your installer.
Be sure to fully test updates if you make changes to your npm-shrinkwrap.json
file.