Welcome to SvelteKit + GitHub Pages
It is super easy to publish SvelteKit project on GitHub Pages. Create a GitHub repo before starting this.
- Install SvelteKit
- Install @sveltejs/adapter-static and gh-pages. `npm i -D @sveltejs/adapter-static gh-pages`
- Update svelte.config.js by changing adapter-auto to adaptor-static.
`import adapter from '@sveltejs/adapter-static';`
- Add the following to `src/routes/+layout.js`
`export const prerender = true;`
- Add a script to package.json. `"gh-pages": "npm run build && npx gh-pages -d build"`
Now you just need to run `npm run gh-pages`.