Skip to content

Build CLI Plugin

A staticbolt CLI plugin that registers a build command for production builds. It lets you run staticbolt from the command line to build your static website with production optimizations enabled.

Installation

The plugin ships as part of @staticbolt/core. You do not need to install anything else.

Usage

In your .staticbolt.ts configuration file:

import { defineConfig } from "@staticbolt/core";
import { buildCliPlugin } from "@staticbolt/core/plugins";
export default defineConfig({
plugins: [buildCliPlugin()],
});

Then run from the command line:

Terminal window
npx staticbolt build
# or using the alias
npx staticbolt b

Plugin Options

command

  • Type: string
  • Default: "build"

The name of the CLI command to register.

buildCliPlugin({
command: "compile",
});

aliases

  • Type: string[]
  • Default: ["b"]

Other names that also run the build command.

buildCliPlugin({
aliases: ["b", "compile", "prod"],
});

Behavior

When executed, the build command:

  1. Sets the app to production mode (production: true)
  2. Creates a new App instance with the provided configuration
  3. Runs the full build pipeline
  4. Reports the total build time in seconds

This plugin usually goes last in the plugins array, next to the other CLI plugins. It does not take part in the build pipeline itself.