CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-babel--preset-stage-0

tessl install tessl/npm-babel--preset-stage-0@7.8.0

Deprecated Babel preset for stage 0 plugins that provides migration guidelines to explicit plugin configurations

Agent Success

Agent success rate when using this tile

80%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.21x

Baseline

Agent success rate without this tile

66%

task.mdevals/scenario-4/

Targeted Transpilation Bundles

Generate two JavaScript bundles from a source string: one aimed at legacy environments that require downlevel syntax and injected polyfills, and one aimed at modern modules that should stay as close as possible to the original syntax while avoiding unnecessary polyfills. The targets must be configurable at call time to exercise environment-aware tuning.

Capabilities

Dual output per target set

  • Given configurable legacy and modern target lists, produce both outputs from the same input string, with legacy code rewritten to ES5-compatible syntax and modern code preserving ES module syntax and modern operators. @test

Usage-based polyfills

  • When the source uses built-ins such as Promise.finally and Array.from, the legacy bundle injects only the missing polyfills for the selected targets using a stable library version 3 source, while the modern bundle omits polyfills if the targets already support the features. @test

Target-aware metadata

  • Return metadata alongside each bundle that lists the resolved target environments and the polyfills that were injected, ensuring the lists reflect the configured targets rather than hardcoded defaults. @test

Implementation

@generates

API

export interface BuildTargetProfiles {
  legacy: string | string[];
  modern: string | string[];
}

export interface BundleOutput {
  code: string;
  map?: object;
  targets: string[];
  polyfills: string[];
}

export interface BuildOptions {
  input: string;
  targets?: BuildTargetProfiles;
  sourceMaps?: boolean;
}

export async function buildBundles(options: BuildOptions): Promise<{
  legacy: BundleOutput;
  modern: BundleOutput;
}>;

Dependencies { .dependencies }

Babel core { .dependency }

Compiles source text using a configurable preset pipeline. @satisfied-by

Environment preset { .dependency }

Selects syntax transforms and polyfill injection based on the chosen targets. @satisfied-by

Core-JS { .dependency }

Supplies stable standard-library polyfills required by legacy environments. @satisfied-by

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/@babel/preset-stage-0@7.8.x
tile.json