Cell API
    Preparing search index...

    Interface CellDevServerOptions

    interface CellDevServerOptions {
        backend?: boolean;
        devHandlers?: {
            handler: (
                req: IncomingMessage,
                res: ServerResponse,
                next: (error?: unknown) => void,
            ) => void;
            path: string;
        }[];
        disabled?: string[];
        entry?: Partial<Record<Target, string>>;
        entryName?: string;
        env?: Record<string, string | undefined>;
        external?: string[];
        extraModules?: ExtraModule[];
        format?: "esm" | "cjs";
        host?: string;
        listen?: boolean;
        logger?: Logger;
        logLevel?: "info" | "warn" | "error" | "silent";
        mode?: string[];
        outDir?: string;
        plugins?: PluginOption[];
        port?: number;
        preset?: string;
        root?: string;
        runtime?: any;
        runtimeDisabled?: string[];
        single?: boolean;
        sourcemap?: boolean;
        startTimeout?: number;
        targets?: Target[];
        vite?: UserConfig;
        watchFiles?: string[];
        onReload?(files: string[], error?: any): void;
        onRequest?(record: DevRequestRecord): void;
        onRestart?(files: string[]): void;
    }

    Hierarchy (View Summary)

    Index
    backend?: boolean

    Start the backend entry. Default true; false only loads modules on request (CellDevServer.import), as cell check does.

    devHandlers?: {
        handler: (
            req: IncomingMessage,
            res: ServerResponse,
            next: (error?: unknown) => void,
        ) => void;
        path: string;
    }[]

    Handlers of toolchain modules by path prefix, before the backend.

    disabled?: string[]

    Components left out entirely, with the dependencies only they lead to ('!name' in cell.config.ts).

    Optionalentry

    entry?: Partial<Record<Target, string>>

    Explicit entry specifiers; they win over entryName.

    entryName?: string

    Name of the backend entry to pick from the components' entries (chosen by the preset, e.g. http).

    env?: Record<string, string | undefined>

    Environment for ${env.*} in frontend configuration and CELL_FRONTEND__ / CELL_BACKEND__ overrides. Default: process.env.

    external?: string[]

    Packages the server bundle must not inline; they are copied into server/node_modules.

    extraModules?: ExtraModule[]

    DI modules added by toolchain modules, loaded after the components' own (cell.addRuntimeModule).

    format?: "esm" | "cjs"

    Server bundle format. Default esm (server/index.mjs); cjs emits server/index.cjs.

    host?: string

    Interface to listen on. Default: cell.server.host of the backend, else 127.0.0.1.

    listen?: boolean

    Listen on a port and watch files. Default true; false runs in-process only (createTestApp): requests go through CellDevServer.handler.

    logger?: Logger

    Vite logger, e.g. one that writes to stderr for --json.

    logLevel?: "info" | "warn" | "error" | "silent"
    mode?: string[]

    Active modes, in order; later modes override earlier ones.

    outDir?: string

    Output directory, relative to the project root. Default .cell/output.

    plugins?: PluginOption[]

    Plugins of toolchain modules, after the Cell plugin.

    port?: number

    Port of the one server for frontend and backend. Default: cell.server.port of the backend, else 3000.

    preset?: string

    Name of the preset that chose the options, recorded in manifest.json.

    root?: string
    runtime?: any

    Runtime of the server bundle. Default node. workerd (Cloudflare Workers) has no import.meta.url / dirname / filename: the bundle uses WORKERD_SERVER_FILE instead.

    runtimeDisabled?: string[]

    Components whose DI modules are left out; their configuration still applies.

    single?: boolean

    Embed the frontend in the server bundle (cell build --single): the server serves it from memory, and the output has no public directory. Only with both targets.

    sourcemap?: boolean
    startTimeout?: number

    How long the backend may take to start. Default 60s.

    targets?: Target[]

    Targets to build; default: backend plus the components' targets.

    vite?: UserConfig

    Merged into the Vite configuration (the vite field of cell.config.ts).

    watchFiles?: string[]

    More files whose change restarts with a new toolchain (cell.addWatchFile).

    • The backend was reloaded after files changed; error when it failed to start again.

      Parameters

      • files: string[]
      • Optionalerror: any

      Returns void

    • Files changed that the project model depends on (cell*.yml, package.json, cell.config.*): restart with a new toolchain.

      Parameters

      • files: string[]

      Returns void