Installation
Install
pnpm add @sigx/ssg sigx @sigx/router @sigx/server-renderer
pnpm add -D vite @sigx/vitePeer dependencies
@sigx/ssg declares these peer dependencies:
sigx@>=0.12.0 <0.13.0— the SignalX runtime.@sigx/router@>=0.9.0 <0.10.0— the router the generated client entry drives. Its version line no longer mirrors core's minor (router0.9pairs with core0.12) — read the peer range, not the version number.@sigx/server-renderer@>=0.12.0 <0.13.0— used for the SSR render and the hydration client plugin.vite@>=8.0.0— Vite 8 or newer is required. The generator uses Vite 8'soxcJSX transform rather than esbuild.@sigx/cli@>=0.4.0— optional, only needed for thesigx ssgCLI subcommands.
Optional, auto-detected when installed:
@tailwindcss/vite— the zero-config dev server adds it automatically if present.- Theme packages such as
@sigx/ssg-theme-daisyui, referenced through the configthemefield. See Themes.
Heavy build-time dependencies (MDX, Shiki, gray-matter, fast-glob, the unified / remark / rehype stack, and the SignalX server renderer) are bundled into the package, so you do not install them separately.
Two ways to wire it up
1. CLI plugin (zero-config)
Drop an ssg.config.ts in your project root and run the CLI subcommands:
pnpm dlx sigx ssg dev
pnpm dlx sigx ssg build
pnpm dlx sigx ssg previewThe package auto-registers as a @sigx/cli plugin. Its detect step activates when an ssg.config.{ts,js,mjs} file exists, so no Vite config is required.
2. Vite plugin
Import the plugin and add it to your Vite plugins array alongside sigx() from @sigx/vite. ssgPlugin() returns an array of plugins (the main plugin plus the MDX plugin), so spread it or pass it directly:
import { defineConfig } from 'vite';
import sigx from '@sigx/vite';
import ssg from '@sigx/ssg/vite';
export default defineConfig({
plugins: [sigx(), ssg()],
});
TypeScript: virtual module types
To get ambient declarations for the virtual modules (virtual:ssg-routes, virtual:ssg-navigation, virtual:ssg-data, and virtual:generated-layouts), add the @sigx/ssg/virtual entry to compilerOptions.types in tsconfig.json:
{
"compilerOptions": {
"types": ["@sigx/ssg/virtual"]
}
}
This subpath provides type declarations only; it has no runtime.
Zero-config entry detection
The generator auto-creates the client entry, server entry, and index.html unless you supply your own. It detects:
- Client entry —
src/main.{tsx,ts},src/entry-client.{tsx,ts}, orsrc/entry.{tsx,ts}. - Server entry —
src/entry-server.{tsx,ts}. - HTML template —
index.html. - Global CSS — auto-imported if found at
src/styles/global.css(ormain.css/index.css),src/style.css,src/global.css, orsrc/index.css.
You can override any of these through config (clientEntry, serverEntry, htmlTemplate — set htmlTemplate: false to force the generated template).
Next steps
- Configuration & Content — routing, layouts, collections, MDX, and the full config.
- Commands — every
sigx ssgcommand with its flags. - API Reference — the public API surface.
