or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-8/

Watch Backend Control

Implement a small wrapper that runs the bundler in watch mode with an explicit watch root, a selectable watcher backend, and ignore rules for noisy paths. The wrapper should expose a simple API and minimal logging so a developer can run and stop the watcher programmatically.

Capabilities

Custom watcher backend

  • Starting the watcher with a supported backend identifier initializes watch mode with that backend and logs which backend is active. @test
  • Supplying an unsupported backend identifier fails fast before watching begins and reports the invalid choice. @test

Ignore patterns

  • Changes to paths matching configured ignore globs do not trigger rebuild notifications or timestamps. @test
  • A change to a non-ignored file under the watch root triggers a rebuild notification that names the changed file. @test

Watch root selection

  • Only files under the configured watch directory can trigger rebuilds; changes outside that directory are ignored. @test

Implementation

@generates

API

/**
 * Starts watch mode with a chosen backend, ignore globs, and watch root.
 * Returns an async function that stops the watcher.
 *
 * @param {Object} options
 * @param {string} options.entry - Entry file or directory to build.
 * @param {string} options.watchDir - Directory that defines the watch scope.
 * @param {string[]} options.ignore - Glob patterns that must not trigger rebuilds.
 * @param {string=} options.backend - Optional watcher backend identifier.
 * @param {(message: string) => void} options.log - Logger for startup and rebuild notices.
 * @returns {Promise<() => Promise<void>>}
 */
export async function runWatcher(options);

Dependencies { .dependencies }

parcel { .dependency }

Bundler and watcher dependency for running builds with selectable backends and ignore lists.