or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-4/

Production Bundle Runner

Create a small TypeScript module that triggers production bundling for web assets using the dependency's production build command rather than its dev server or watch mode.

Capabilities

Production build outputs optimized bundles

  • Running the build with at least two entry files bundles them for production, writing to the provided distDir with minified, content-hashed asset filenames. @test
  • Passing sourceMaps: false omits source maps from the emitted assets. @test

Public URL support

  • When publicUrl is provided, emitted HTML and manifest references prefix asset URLs with that base URL. @test

Custom cache directory

  • When cacheDir is provided, the build uses (or creates) that directory for caching instead of the default cache location, and reuses it on subsequent builds. @test

Failure handling

  • The build rejects and produces no bundles when any entry path is invalid or missing. @test

Implementation

@generates

API

export interface BuildOptions {
  entries: string[]; // entry HTML or JS files to bundle for production
  distDir: string;   // destination directory for compiled assets
  publicUrl?: string; // base URL prefix for emitted asset references
  cacheDir?: string; // optional cache directory override
  sourceMaps?: boolean; // enable or disable source map generation
}

export interface BuildResult {
  distDir: string;
  bundleCount: number;
}

export function runProductionBuild(options: BuildOptions): Promise<BuildResult>;

Dependencies { .dependencies }

parcel { .dependency }

Provides the production bundling command-line interface used to generate optimized builds.