Commands#

@sigx/ssg contributes three subcommands to the sigx CLI: dev, build, and preview. They are available when @sigx/cli 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
npx 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
npx 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
npx sigx ssg build [--config <path>] [--verbose]

Flags

FlagTypeDescription
--config <path>stringPath to ssg.config.ts.
--verbosebooleanVerbose logging.

Each rendered page is written to <outDir>/<path>/index.html. Per-page head tags (title, description, canonical, Open Graph, Twitter) are injected at the page's head marker.

sigx ssg preview#

Previews the production build locally through the Vite preview server. The default port is 4173.

Terminal
npx 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
npx sigx ssg dev
npx sigx ssg build
npx 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.