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:

Terminal
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.

Terminal
pnpm dlx sigx ssg dev [--config <path>] [--port <n>] [--host] [--open] [--verbose]

Flags

FlagTypeDescription
--config <path>stringPath to ssg.config.ts.
--port <n>numberPort for the dev server (default 5173).
--hostbooleanExpose the server to the network.
--openbooleanOpen the browser on start.
--verbosebooleanVerbose 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.

Terminal
pnpm dlx sigx ssg build [--config <path>] [--verbose] [--drafts] [--concurrency <n>]

Flags

FlagTypeDescription
--config <path>stringPath to ssg.config.ts.
--verbosebooleanVerbose logging.
--draftsbooleanInclude pages with draft: true frontmatter (excluded from production builds by default).
--concurrency <n>numberPages 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.

Terminal
pnpm dlx sigx ssg preview [--config <path>] [--port <n>] [--host] [--open]

Flags

FlagTypeDescription
--config <path>stringPath to ssg.config.ts.
--port <n>numberPort for the preview server (default 4173).
--hostbooleanExpose the server to the network.
--openbooleanOpen the browser on start.

A typical workflow#

Terminal
pnpm dlx sigx ssg dev
pnpm dlx sigx ssg build
pnpm dlx sigx ssg preview

Next steps#

  • Configuration & Content — routing, layouts, collections, MDX, and the full config.
  • API Reference — the programmatic dev, build, and preview functions and the rest of the public API.