or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-1/

CDN-Aware Static Build

Build a small static web app that can be bundled for multiple outputs while applying the correct public URL prefix to every emitted asset reference.

Capabilities

Default public URL

  • Building without a provided base uses / as the public URL for all generated asset references (HTML, JS, CSS). @test

Custom CDN prefix

  • Providing a base such as https://cdn.example.com/static prefixes every emitted asset reference (including source maps) with that value. @test

Target-specific override

  • A named target can override the public URL while sharing the same sources, writing its output to its own directory with the overridden prefix applied. @test

Source layout

  • Entry HTML: src/index.html referencing a JS module and a stylesheet.
  • Stylesheet imports at least one image asset so the emitted CSS contains an asset URL that must be prefixed.
  • Default builds write to dist/; target-specific builds write to dist/<targetName>/.

Implementation

@generates

API

/**
 * Builds the app using the default public URL and writes assets to disk.
 */
export async function buildDefault(): Promise<void>;

/**
 * Builds the app with a provided public URL prefix.
 * @param {string} publicUrl base URL prefix for emitted asset references.
 */
export async function buildWithPublicUrl(publicUrl: string): Promise<void>;

/**
 * Builds a named target with its own public URL and output directory.
 * @param {string} targetName build target identifier.
 * @param {string} publicUrl base URL prefix for that target's assets.
 */
export async function buildTargetWithPublicUrl(targetName: string, publicUrl: string): Promise<void>;

Dependencies { .dependencies }

parcel { .dependency }

Asset bundler used to build outputs with configurable public URLs.