Skip to content

Instantly share code, notes, and snippets.

@koobitor
Created June 14, 2022 14:40
Show Gist options
  • Save koobitor/801fdde334cbc5f9041562c2e78b17b7 to your computer and use it in GitHub Desktop.
Save koobitor/801fdde334cbc5f9041562c2e78b17b7 to your computer and use it in GitHub Desktop.

1 Install the adapter into your project.

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

2 Add the adapter to your project’s svelte.config.js file and pass any options you need.

path svelte.config.js

import adapter from '@sveltejs/adapter-netlify';
import preprocess from "svelte-preprocess";

/** @type {import('@sveltejs/kit').Config} */
const config = {
	preprocess: [
    preprocess({
      postcss: true,
    }),
  ],
	kit: {
		adapter: adapter({
      edge: false,
      split: true
    })
	},
};

export default config;

3 Create a netlify.toml in your project’s base directory and specify a build command and publish directory.

path netlify.toml

[build]
  command = "npm run build"
  publish = "build"

4 Create New Deploy form exist project on netlify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment