or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-7/

Incremental Bundling Watcher

Create a small utility that runs an incremental bundling session in watch mode, producing an initial build and then rebuilding whenever watched sources change.

Capabilities

Runs initial build in watch mode

  • Starting a watch session with entry files produces bundled output to the chosen dist directory and resolves when the first build finishes. @test

Responds to changes with incremental rebuilds

  • Modifying a watched source triggers a rebuild that reports which source files changed and when the rebuild finished. @test

Supports watch scope and ignores

  • Providing a custom watch root and ignore globs limits which paths trigger rebuilds; ignored files do not cause rebuilds. @test

Graceful shutdown

  • Sending a quit signal through stdin stops watching and returns a final summary without leaving the watcher running. @test

Implementation

@generates

API

/**
 * 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').
 */

Dependencies { .dependencies }

parcel { .dependency }

JavaScript bundler used to run incremental watch builds with hot reload and cache-aware rebuilds.