> 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/preact.md).

# Preact

React-compatible 3 kB alternative. Hostinger runs Preact apps as static bundles built with Vite — they deploy under the Vite application type.

**`app_type`:** `vite`

## Static mode

Preact on Hostinger is always static via Vite.

### `package.json`

```json
{
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview"
  },
  "devDependencies": {
    "vite": "^5.0.0",
    "@preact/preset-vite": "^2.8.0"
  }
}
```

### `vite.config.js`

```js
import { defineConfig } from 'vite';
import preact from '@preact/preset-vite';

export default defineConfig({
  plugins: [preact()],
});
```

### hPanel settings

| Field            | Value      |
| ---------------- | ---------- |
| Application type | `vite`     |
| Build script     | `build`    |
| Output directory | `dist`     |
| Entry file       | — (static) |

## Server mode

Preact doesn't ship a built-in server runtime. For SSR, use the `other` application type and follow Preact's [SSR guide](https://preactjs.com/guide/v10/server-side-rendering/) to wire up Express or your own Node entry.

## Notes

* Scaffold a new project: `npm create preact` — picks sensible defaults including TypeScript support.
* Preact is API-compatible with React; you can use most React libraries via `preact/compat` aliases.

***

*Last updated: July 22, 2026*
