|
| 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. |
0 commit comments