Home
Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Setup And Deploy A SvelteKit App On Netlify

This is for making a sveltekit app that's one directory off the root. I like doing that so I can put docs and assets in the repo without out them being in the svelte dir. After cloning down a repo and moving into it I do this :

First, I make this netlify.toml file in the root

toml
[build]
  base = "/site/"
  publish = "build"
  command = "npm run build"

Then I make a [TODO: Code shorthand span ] sub - directory and initialize svelte in it :

bash
mkdir site
cd site
npm init svelte@next .

(If you've never run the command before, you'll probably be asked if you want to install [TODO: Code shorthand span ] something which you'll need to do to continue.)

That brings up the install wizard :

Choose : "Skeleton project" Set TypeScript, ESLint, Prettier, Playwright as you see fit

Then, I run :

bash
npm install -D @sveltejs/adapter-netlify@next

Config directions are here . It's a little unclear, but it looks like the [TODO: Code shorthand span ] that comes in the file is replaced by : ` import adapter from '@sveltejs/adapter - netlify'; ` . The file format that comes from svelte is a little different than the netlify docs. Doesn't look like that matters, but I'm using this for the full contents of the file :

javascript
import adapter from '@sveltejs/adapter-netlify';

/** @type {import('@sveltejs/kit').Config} */
const config = {
	kit: {
		adapter: adapter()
	}
};

export default config;

NOTE :

- The Netlify docs say to add a [TODO: Code shorthand span ] in, but when trying to run the app, it says : [TODO: Code shorthand span ] so I removed it.