> For the complete documentation index, see [llms.txt](https://docs.hostinger.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hostinger.com/node.js/overview-1/sveltekit.md).

# SvelteKit

Full-stack Svelte framework with adapters for different deployment targets. Hostinger supports both static and server modes via adapters.

**`app_type`:** `svelte-kit`

## `package.json`

```json
{
  "scripts": {
    "dev": "vite dev",
    "build": "vite build",
    "preview": "vite preview"
  }
}
```

## Static (adapter-static)

For fully pre-rendered sites with no server code.

Install the adapter:

```bash
npm install -D @sveltejs/adapter-static
```

Configure `svelte.config.js`:

```js
import adapter from '@sveltejs/adapter-static';

export default {
  kit: {
    adapter: adapter({ fallback: 'index.html' }),
  },
};
```

**hPanel settings:**

| Field            | Value        |
| ---------------- | ------------ |
| Application type | `svelte-kit` |
| Build script     | `build`      |
| Output directory | `build`      |
| Entry file       | —            |

> **Note:** adapter-static requires either full pre-rendering (`export const prerender = true` in your root layout) or a SPA fallback (`fallback: 'index.html'`).

## Server (adapter-node)

Runs a Node server that renders pages on each request and handles form actions, load functions with fetch, etc.

Install the adapter:

```bash
npm install -D @sveltejs/adapter-node
```

Configure `svelte.config.js`:

```js
import adapter from '@sveltejs/adapter-node';

export default {
  kit: { adapter: adapter() },
};
```

**hPanel settings:**

| Field            | Value            |
| ---------------- | ---------------- |
| Application type | `svelte-kit`     |
| Build script     | `build`          |
| Output directory | `build`          |
| Entry file       | `build/index.js` |

## Per-route prerendering

Mix static and server rendering by setting `prerender` per-route:

```ts
// src/routes/about/+page.ts
export const prerender = true;   // static

// src/routes/dashboard/+page.ts
export const prerender = false;  // server
```

Deploy as `adapter-node` — SvelteKit pre-renders the marked routes at build and serves the rest on demand.

## Notes

* Node 20 or newer.
* Default adapter is `adapter-auto` which picks based on the host; replace it with `adapter-static` or `adapter-node` for explicit control on Hostinger.

***

*Last updated: July 22, 2026*
