Skip to content

Commit c16bb66

Browse files
authored
Add "Deployment plugins" guide page for SolidStart 2 (#1617)
chore: add deployment plugins guide page
1 parent ea1d476 commit c16bb66

4 files changed

Lines changed: 94 additions & 7 deletions

File tree

src/routes/solid-start/v2/(0)index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ description: >-
1818

1919
SolidStart v2 builds a full-stack app on top of [Solid v1](/) and [Vite v8+](https://vite.dev). If you're currently using SolidStart v1, it's mainly a tooling and stability upgrade.
2020

21-
What's new in SolidStart v2 is that it uses Vite's Environment API for client and server builds and therefore works with deployment plugins such as [Nitro v3](https://nitro.build) and the [Cloudflare Vite plugin](https://www.npmjs.com/package/@cloudflare/vite-plugin).
21+
What's new in SolidStart v2 is that it uses Vite's Environment API for client and server builds and therefore works with deployment plugins such as [Nitro v3](https://nitro.build), the [Cloudflare Vite plugin](https://developers.cloudflare.com/workers/vite-plugin/), and the [Netlify Vite plugin](https://docs.netlify.com/build/frameworks/framework-setup-guides/solidstart/).
2222

2323
SolidStart is router agnostic, and can be used with either the official [Solid Router v1](/solid-router) or [TanStack Solid Router v1](https://tanstack.com/router/latest).
2424

src/routes/solid-start/v2/(1)getting-started.mdx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,31 +42,29 @@ dev
4242

4343
## Configuration
4444

45-
Configuration lives in `vite.config.ts`. SolidStart configures the application and Nitro v3 supplies the server and deployment integration.
45+
Configuration lives in `vite.config.ts`. Start with the `solidStart()` plugin, which configures the application:
4646

4747
```tsx title="vite.config.ts"
4848
import { defineConfig } from "vite";
49-
import { nitro } from "nitro/vite";
5049
import { solidStart } from "@solidjs/start/config";
5150

5251
export default defineConfig({
53-
plugins: [solidStart(), nitro()],
52+
plugins: [solidStart()],
5453
});
5554
```
5655

5756
If your app already has middleware, `solidStart()` also accepts a `middleware` option:
5857

5958
```tsx title="vite.config.ts"
6059
import { defineConfig } from "vite";
61-
import { nitro } from "nitro/vite";
6260
import { solidStart } from "@solidjs/start/config";
6361

6462
export default defineConfig({
65-
plugins: [solidStart({ middleware: "./src/middleware/index.ts" }), nitro()],
63+
plugins: [solidStart({ middleware: "./src/middleware/index.ts" })],
6664
});
6765
```
6866

69-
Use the top-level `nitro` property for Nitro options such as deployment presets, prerendering, tasks, and WebSockets.
67+
To configure a production server runtime and hosting target, continue with [Deployment plugins](/solid-start/v2/guides/deployment-plugins).
7068

7169
## Path alias
7270

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
title: Deployment plugins
3+
use_cases: >-
4+
deployment, hosting, server runtime, adapters, nitro, netlify, cloudflare,
5+
edge functions, workers
6+
tags:
7+
- deployment
8+
- hosting
9+
- vite
10+
- nitro
11+
- netlify
12+
- cloudflare
13+
- server
14+
version: "2.0"
15+
description: >-
16+
Choose and configure a deployment Vite plugin for a SolidStart v2 app.
17+
---
18+
19+
SolidStart v2 uses Vite's Environment API for its client and server builds. The `solidStart()` plugin configures the application, while a deployment Vite plugin integrates the server build with a production runtime and hosting target.
20+
21+
Choose one deployment plugin. Nitro provides portable deployment presets, while the Netlify and Cloudflare plugins integrate directly with their respective platforms.
22+
23+
## Nitro
24+
25+
[Nitro v3](https://nitro.build/) supports multiple deployment targets through presets.
26+
27+
```package-install
28+
nitro
29+
```
30+
31+
Add `nitro()` after `solidStart()`:
32+
33+
```tsx title="vite.config.ts"
34+
import { nitro } from "nitro/vite";
35+
import { defineConfig } from "vite";
36+
import { solidStart } from "@solidjs/start/config";
37+
38+
export default defineConfig({
39+
plugins: [solidStart(), nitro()],
40+
});
41+
```
42+
43+
Use the top-level `nitro` property for deployment presets, prerendering, tasks, WebSockets, and other Nitro options. See the [Nitro configuration reference](https://nitro.build/config).
44+
45+
## Netlify
46+
47+
The [Netlify Vite plugin](https://docs.netlify.com/build/frameworks/framework-setup-guides/solidstart/) prepares the server build for Netlify Functions and emulates Netlify platform features during development.
48+
49+
```package-install-dev
50+
@netlify/vite-plugin
51+
```
52+
53+
Add the plugin after `solidStart()` and enable its build support:
54+
55+
```tsx title="vite.config.ts"
56+
import netlify from "@netlify/vite-plugin";
57+
import { defineConfig } from "vite";
58+
import { solidStart } from "@solidjs/start/config";
59+
60+
export default defineConfig({
61+
plugins: [solidStart(), netlify({ build: { enabled: true } })],
62+
});
63+
```
64+
65+
No SolidStart-specific adapter is required. Netlify detects SolidStart and can supply the build command and publish directory automatically. Its [SolidStart v2 announcement](https://www.netlify.com/changelog/2026-08-06-solidstart-2-on-netlify/) explains how the integration uses Vite's Environment API.
66+
67+
## Cloudflare
68+
69+
The [Cloudflare Vite plugin](https://developers.cloudflare.com/workers/vite-plugin/) runs the server build in the Workers runtime during development and prepares it for deployment to Cloudflare.
70+
71+
```package-install-dev
72+
@cloudflare/vite-plugin wrangler
73+
```
74+
75+
Map the Worker to SolidStart's `ssr` environment:
76+
77+
```tsx title="vite.config.ts"
78+
import { cloudflare } from "@cloudflare/vite-plugin";
79+
import { defineConfig } from "vite";
80+
import { solidStart } from "@solidjs/start/config";
81+
82+
export default defineConfig({
83+
plugins: [cloudflare({ viteEnvironment: { name: "ssr" } }), solidStart()],
84+
});
85+
```
86+
87+
The `viteEnvironment` option merges the Workers runtime configuration with SolidStart's server environment. Follow the Cloudflare guide to add a Wrangler configuration and any platform bindings.

src/routes/solid-start/v2/reference/entrypoints/(0)vite-config.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,6 @@ export default defineConfig({
5454

5555
SolidStart v2 requires Vite 8 or 9. The default scripts are `vite dev` and `vite build`; `vite preview` locally serves a completed production build.
5656

57+
These examples use Nitro, but SolidStart also works with other deployment Vite plugins. See [Deployment plugins](/solid-start/v2/guides/deployment-plugins) for Netlify and Cloudflare configuration.
58+
5759
For the available server options and deployment presets, see the [Nitro configuration reference](https://nitro.build/config).

0 commit comments

Comments
 (0)