[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
  1. Quickstarts
  2. SvelteKit

Deploy a SvelteKit App

SvelteKit is an exciting new development from the folks who created Svelte. While Svelte is great for static site creation, SvelteKit is a framework for building high-performance web applications. It includes routing, code-splitting, offline support, and server-rendered views with client-side hydration. Each page of a SvelteKit app is actually a Svelte component!

You can choose to deploy it as a Node Server or Static Site.

The key difference is that the app deployed as a Node server is built using the SvelteKit Node.js adapter. The static site uses the SvelteKit static adapter to generate static HTML for all pages.

Deploy as a Node Server

A sample app is deployed at https://sveltekit-app.onrender.com. Follow the steps below to start building your own SvelteKit app.

One-Click Deploy

Click Deploy to Render below and follow the prompts to deploy SvelteKit to Render.

Deploy to Render

Manual Deploy
  1. Create your own repo from Render’s SvelteKit template repo on GitHub (you may need to log in first).

    • Alternatively, you can clone the repo and push your clone to GitLab or Bitbucket.
  2. Create a new Web Service on Render, and give Render permission to access the repo.

  3. Use the following values during creation:

    RuntimeNode
    Build Commandnpm install && npm run build
    Start Commandnode build/index.js

That’s it! Your SvelteKit app will be live on your Render URL as soon as the build finishes and the service starts.

Deploy as a Static Site

A sample static site is deployed at https://sveltekit-static.onrender.com. Follow the steps below to start building your own site.

One-Click Deploy

Click Deploy to Render below and follow the prompts to deploy SvelteKit to Render as a Static Site.

Deploy to Render

Manual Deploy
  1. Create your own repo from Render’s SvelteKit Static template repo on GitHub (you may need to log in first).

  2. Create a new Static Site on Render, and give Render permission to access the repo.

  3. Use the following values during creation:

    Build Commandnpm install && npm run build
    Publish Directorybuild

That’s it! Your static site will be live on your Render URL as soon as the build finishes.