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
[build]
base = "/site/"
publish = "build"
command = "npm run build"
Then I make a [TODO: Code shorthand span ] sub - directory and initialize svelte in it :
(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 :
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 :
;
/** @type {import('@sveltejs/kit').Config} */
const 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.