The krate.config.ts entry point and a map of every option group.
#Configuration
Krate is configured with a krate.config.ts file at the project root, typed with defineConfig from @krate/core. Every supported key is type-checked — unknown or misspelled options become compile errors.
import { defineConfig, sitemap, docs } from '@krate/core';
export default defineConfig({
entry: "src/index.tsx",
outDir: "dist",
pagesDir: "src/pages",
minify: true,
tailwind: { enabled: false, scanDirs: ["src"] },
redirects: [{ source: "/old", destination: "/new", permanent: true }],
plugins: [
sitemap({ baseUrl: "https://example.com" }),
docs({ contentDir: "src/content/docs", title: "Docs" }),
],
});React syntax (useState, useEffect, useRef, JSX) is transpiled to Krate signals and effects automatically — no config is required. See React Compatibility.
#Option groups
This page is a map; the Config Reference documents every key and its default.
| Group | Key(s) | Reference |
|---|---|---|
| Build | entry, outDir, pagesDir, publicDir, minify, sourcemap | Build |
| Dev server | devServer | Dev server |
| Rendering | viewTransitions, ppr, ssr, output | SSR / Streaming |
| CSS & Tailwind | tailwind | Tailwind CSS |
| Markdown | markdown | Markdown |
| Content | content, pathAliases, tsBaseDir | Content collections |
| Server | server, basePath, redirects, rewrites | Server |
| Security | csp, cors | Content Security Policy |
| SEO | seo, robots | SEO & robots |
| Checks | checks | Quality checks |
| Plugins | plugins | Plugins |
Last updated: 2026-10-16
Contributors: Noinkin