Two Easy Ways to Publish Your Svelte Project on GitHub Pages

Get your website online for free with Svelte and GitHub Pages

Shinichi Okada
mkdir Awesome

--

From Text to Photo Editor

Introduction

One of the advantages of using Svelte over SvelteKit is that you can use it for GitHub Pages. GitHub Pages is a free service from GitHub that lets you host static websites directly from a GitHub repository. It’s an easy way to show your website without needing extra hosting. GitHub Pages supports HTML, CSS, JavaScript, and other types of files, making it a good choice for personal, project, and information websites.

This article will show you two easy ways to host your Svelte project on GitHub Pages.

Setting up

You can use your own Svelte repository or Svelte-start project for this article. This project provides a foundation for developing with Svelte and Vite, including preconfigured support for TailwindCSS, Flowbite-Svelte, and Svelte-Spa-Router. Additionally, it includes a sample implementation of fetching data from a backend API, making it easy to integrate with your own server-side infrastructure.

Cloning the repo:

git clone git@github.com:shinokada/svelte-starter.git my-app
cd my-app
pnpm i

1. Vite.config.js outDir build…

--

--

Shinichi Okada
mkdir Awesome

A programmer and technology enthusiast with a passion for sharing my knowledge and experience. https://codewithshin.com