docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Implement a helper that launches an HTTPS development server for a static entrypoint with configurable host/port and HMR endpoints.
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. @testport is 0, the server starts on a free port, serverUrl includes https and a non-zero port, and stop() frees the port for reuse. @testhmr.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. @teststop() shuts down the HTTPS listener and HMR endpoint without lingering processes or open ports. @testexport 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>;Bundles and serves assets with configurable HTTPS dev server and HMR endpoints.