or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-10/

HTTPS Dev Server Configurator

Implement a helper that launches an HTTPS development server for a static entrypoint with configurable host/port and HMR endpoints.

Capabilities

Starts HTTPS server on requested host/port

  • Given host 127.0.0.1, port 4430, and HTTPS cert/key paths, the returned serverUrl is https://127.0.0.1:4430 and the server responds with the entry asset. @test

Picks available port when auto-selected

  • When port is 0, the server starts on a free port, serverUrl includes https and a non-zero port, and stop() frees the port for reuse. @test

Exposes custom HMR endpoint

  • With hmr.host set to hmr.dev.test and hmr.port set to 9443, hmrUrl uses the https scheme and the provided host/port, and the HMR client endpoint responds successfully. @test

Graceful shutdown

  • Calling stop() shuts down the HTTPS listener and HMR endpoint without lingering processes or open ports. @test

Implementation

@generates

API

export interface DevServerOptions {
  entry: string;
  host: string;
  port: number;
  https: {
    cert: string;
    key: string;
  };
  hmr?: {
    host?: string;
    port?: number;
  };
}

export interface DevServerHandle {
  serverUrl: string;
  hmrUrl: string | null;
  stop(): Promise<void>;
}

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

Dependencies { .dependencies }

parcel { .dependency }

Bundles and serves assets with configurable HTTPS dev server and HMR endpoints.