or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-6/

Lazy Async Bundle Server

A small development server wrapper that serves web entries while deferring async bundle builds until they are requested, with opt-outs for bundles that must be eager.

Capabilities

Defers async bundle output

  • When the server starts, the base entries are available but async bundles matching the lazy scope are not written until a request for their route triggers the build, after which the generated asset appears and can be fetched. @test

Allows eager exceptions

  • Given exclusion globs, async bundles matching those globs are built before first request while other lazy-scoped bundles remain deferred until accessed. @test

Configurable lazy scope

  • Providing include globs limits lazy handling to matching async bundles; non-matching async bundles are built eagerly during startup. @test

Implementation

@generates

API

/**
 * Starts a dev server that delays building async bundles until they are requested,
 * with optional eager exceptions.
 *
 * @param {string[]} entries - HTML or JS entry points to serve.
 * @param {object} [options]
 * @param {string[]} [options.lazyIncludes] - Glob patterns that qualify async bundles for lazy building.
 * @param {string[]} [options.lazyExcludes] - Glob patterns for async bundles that must be built eagerly even when lazy is enabled.
 * @param {number} [options.port] - Port for the server to listen on.
 * @returns {Promise<{ stop: () => Promise<void>, url: string }>} resolves when the server is ready.
 */
export async function startLazyServer(entries, options = {});

Dependencies { .dependencies }

parcel { .dependency }

JavaScript bundler used to serve entries with deferred async bundle handling and eager exceptions.