Deprecated Babel preset for stage 0 plugins that provides migration guidelines to explicit plugin configurations
80
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.
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@generates
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;
}>;Compiles source text using a configurable preset pipeline. @satisfied-by
Selects syntax transforms and polyfill injection based on the chosen targets. @satisfied-by
Supplies stable standard-library polyfills required by legacy environments. @satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-babel--preset-stage-0docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10