Sveltekit On The Edge screenshot

Sveltekit On The Edge

Author Avatar Theme by Rich harris
Updated: 21 Feb 2023
223 Stars

SvelteKit, running on the edge

Categories

Overview:

SvelteKit on the edge allows you to run a demo SvelteKit app on Vercel Edge Functions, which provides fast dynamic server-side rendering close to your users. This enables your app to achieve the speed of static content.

Features:

  • Dynamic Server-side Rendering: SvelteKit on the edge utilizes Vercel Edge Functions to enable dynamic server-side rendering.
  • Fast Performance: By running close to the users, the app can achieve fast rendering speed similar to static content.
  • Ease of Deployment: The app can be easily deployed by linking the repository to your Vercel account or by creating a production build locally.

Installation:

To enable edge functions in your SvelteKit app deployed to Vercel, follow these steps:

  1. Use your package manager (npm, pnpm, or yarn) to install the @sveltejs/adapter-vercel package.
npm install @sveltejs/adapter-vercel
  1. Update the svelte.config.js file in your project to use adapter-vercel instead of the default adapter-auto.
  2. Pass the runtime: 'edge' option to the adapter in the svelte.config.js file.

Summary:

SvelteKit on the edge is a powerful feature that allows you to leverage the benefits of Vercel Edge Functions to achieve fast server-side rendering for your SvelteKit app. By following the installation guide, you can easily enable this feature and deploy your app to Vercel for optimal performance.