docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Create a small utility that runs an incremental bundling session in watch mode, producing an initial build and then rebuilding whenever watched sources change.
/**
* Starts an incremental bundling session that keeps rebuilding on changes.
* @param {string[]} entries absolute or relative entry files to bundle.
* @param {WatchOptions} options options controlling watch scope, output, and shutdown.
* @returns {Promise<WatchSession>} resolves after the initial build is ready.
*/
export async function startWatch(entries, options) {}
/**
* Describes a live watch session, including how to stop it.
* @typedef {Object} WatchSession
* @property {() => Promise<void>} stop stops the watch session and waits for cleanup.
* @property {(message: string) => void} onStatus optional subscriber for human-readable status strings.
*/
/**
* @typedef {Object} WatchOptions
* @property {string} outDir directory for build output.
* @property {string} watchDir optional directory root to scope file watching; defaults to project root.
* @property {string[]} ignoreGlobs optional glob patterns that should not trigger rebuilds.
* @property {boolean} hmr whether to enable hot reload capability for rebuilds.
* @property {(evt: { type: 'buildSuccess' | 'buildFailure', changedFiles?: string[], durationMs: number, diagnostics?: string[] }) => void} onEvent called after each build attempt.
* @property {NodeJS.ReadStream} quitStream optional readable stream monitored for a single-character quit command (e.g., 'q').
*/JavaScript bundler used to run incremental watch builds with hot reload and cache-aware rebuilds.