or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-2/

Dev Server Harness

Build a small harness around the bundler dependency to launch a development server with hot reloading for a single-page sandbox.

Capabilities

Serve default entry with HMR

  • With no options, launches the dev server for src/index.html, reports the accessible URL, and responds over HTTP while watching for source changes. @test
  • Editing src/app.js after startup triggers hot replacement without restarting the server, with the served page reflecting the new content on refresh or HMR push. @test

Custom host and port

  • Accepts explicit host and port options when starting; uses them when available and surfaces a clear error if the port is unavailable instead of silently reassigning. @test

HTTPS toggle

  • When provided certificate and key file paths, serves over HTTPS and the reported URL uses the https scheme. @test

Lazy builds and HMR toggle

  • When lazy mode is enabled, async entry points (for example, route files loaded via dynamic import) are deferred until first request while the main entry stays eagerly built. @test
  • When HMR is disabled via options, the server still serves but reloads occur only on full refresh, and no HMR websocket is opened. @test

Implementation

@generates

API

export type DevServerOptions = {
  entry?: string;
  host?: string;
  port?: number;
  https?: { certFile: string; keyFile: string } | false;
  open?: boolean;
  hmr?: boolean;
  lazy?: { includes?: string[]; exclude?: string[] } | false;
};

export type DevServerHandle = {
  url: string;
  stop(): Promise<void>;
};

export function startDevServer(options?: DevServerOptions): Promise<DevServerHandle>;

Dependencies { .dependencies }

parcel { .dependency }

Provides the bundler, dev server, hot module replacement, HTTPS, and lazy-build support.