Commands
@sigx/ssg adds a sigx ssg command group to the sigx CLI, with three subcommands — dev, build, and preview (each run as sigx ssg <command>). They are available when @sigx/cli (>= 0.4.0) is installed and an ssg.config.{ts,js,mjs} file exists in your project root (the plugin's detect step activates on that file).
Run any of them through your package runner:
pnpm dlx sigx ssg <command>Each subcommand maps directly to a programmatic function (dev(), build(), preview()), so you can also call those from a Node script — see the API Reference.
sigx ssg dev
Starts the SSG development server (Vite). If a vite.config exists it is used; otherwise the command runs zero-config, auto-loading @sigx/vite, optionally @tailwindcss/vite, and the SSG plugins with the oxc automatic JSX transform (import source sigx). The default port is 5173.
pnpm dlx sigx ssg dev [--config <path>] [--port <n>] [--host] [--open] [--verbose]Flags
| Flag | Type | Description |
|---|---|---|
--config <path> | string | Path to ssg.config.ts. |
--port <n> | number | Port for the dev server (default 5173). |
--host | boolean | Expose the server to the network. |
--open | boolean | Open the browser on start. |
--verbose | boolean | Verbose logging. |
sigx ssg build
Builds the static site for production. It loads the config, scans routes, builds the client and SSR bundles with Vite, renders every path (including paths expanded from getStaticPaths) to static HTML in outDir, and writes sitemap.xml and robots.txt.
pnpm dlx sigx ssg build [--config <path>] [--verbose] [--drafts] [--concurrency <n>]Flags
| Flag | Type | Description |
|---|---|---|
--config <path> | string | Path to ssg.config.ts. |
--verbose | boolean | Verbose logging. |
--drafts | boolean | Include pages with draft: true frontmatter (excluded from production builds by default). |
--concurrency <n> | number | Pages to render in parallel (default 20). |
Each rendered page is written to <outDir>/<path>/index.html (a 404 page becomes a root 404.html). Per-page head tags (title, description, canonical, Open Graph, Twitter) are injected at the page's head marker. A failed page render fails the build with a non-zero exit. The build works zero-config too — without a vite.config, the same plugin set the dev server assembles is injected automatically.
sigx ssg preview
Previews the production build locally through the Vite preview server. The default port is 4173.
pnpm dlx sigx ssg preview [--config <path>] [--port <n>] [--host] [--open]Flags
| Flag | Type | Description |
|---|---|---|
--config <path> | string | Path to ssg.config.ts. |
--port <n> | number | Port for the preview server (default 4173). |
--host | boolean | Expose the server to the network. |
--open | boolean | Open the browser on start. |
A typical workflow
pnpm dlx sigx ssg dev
pnpm dlx sigx ssg build
pnpm dlx sigx ssg previewNext steps
- Configuration & Content — routing, layouts, collections, MDX, and the full config.
- API Reference — the programmatic
dev,build, andpreviewfunctions and the rest of the public API.
