Stone.js API
    Preparing search index...

    A Stone.js CLI plugin: a module's way to participate in the build/bundle lifecycle.

    A plugin is a plain object (or the return of a factory). It is fully agnostic of any specific module: the CLI never knows what a plugin does, only when to call it. Plugins are collected from stone.config (plugins: [...], the explicit path, open to any package) and, for first-party @stone-js/* packages only, auto-discovered from their package.json stone.cliPlugin contract (the zero-config path, opt-out via autoDiscoverPlugins: false).

    The lifecycle exposes three moments, from earliest to latest:

    • blueprintMiddleware: config phase, augment stone.builder.*.
    • onPrepare: codegen phase (build and dev), write .stone/ files and contribute modules/config.
    • onBundle: just before the bundler runs, for advanced bundler-level participation.
    interface StoneCliPlugin {
        blueprintMiddleware?: StonePluginBlueprintMiddleware[];
        description?: string;
        name: string;
        onBundle?: (context: StonePluginContext) => Promiseable<void>;
        onPrepare?: (context: StonePluginContext) => Promiseable<void>;
    }
    Index
    blueprintMiddleware?: StonePluginBlueprintMiddleware[]

    Config-phase middleware, run in the CLI's blueprint pipeline before any command.

    Use this to read or augment stone.builder.* configuration. Runs for every command.

    description?: string

    A short description of what the plugin does (shown alongside the name).

    name: string

    A unique, human-readable name (shown when the plugin is loaded).

    onBundle?: (context: StonePluginContext) => Promiseable<void>

    Bundle phase: called just before the bundler (Rollup/Vite) runs, after onPrepare. Advanced hook for bundler-level participation, e.g. mutating stone.builder.rollup/vite on the blueprint so the plugin's bundler options are honored.

    Type Declaration

    onPrepare?: (context: StonePluginContext) => Promiseable<void>

    Codegen phase: called once per build, before the entry point is generated, for both build (production) and dev. Write files into .stone/ and contribute modules or blueprint statements to the built app via the StonePluginContext helpers.

    Type Declaration