vite.config.ts

vite.config.ts is the configuration entrypoint for a SolidStart v2 application. It replaces v1's app.config.ts.

import { nitro } from "nitro/vite";
import { defineConfig } from "vite";
import { solidStart } from "@solidjs/start/config";
export default defineConfig({
plugins: [solidStart(), nitro()],
});

Responsibilities

  • Pass application, routing, middleware, environment, and serialization settings to solidStart().
  • Add ordinary Vite plugins and options at the Vite config level.
  • Pass server, deployment, prerendering, task, and WebSocket settings through the top-level nitro property.
import { nitro } from "nitro/vite";
import { defineConfig } from "vite";
import { solidStart } from "@solidjs/start/config";
export default defineConfig({
plugins: [
solidStart({
middleware: "./src/middleware/index.ts",
serialization: { mode: "json" },
}),
nitro(),
],
nitro: {
preset: "node_server",
prerender: {
routes: ["/"],
},
},
});

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

These examples use Nitro, but SolidStart also works with other deployment Vite plugins. See Deployment plugins for Netlify and Cloudflare configuration.

For the available server options and deployment presets, see the Nitro configuration reference.

Last updated: 8/6/26, 5:44 PMEdit this pageReport an issue with this page