or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/@babel/runtime@7.28.x
tile.json

tessl/npm-babel--runtime

tessl install tessl/npm-babel--runtime@7.28.0

Babel's modular runtime helpers that provide transpilation support for modern JavaScript features

Agent Success

Agent success rate when using this tile

94%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.19x

Baseline

Agent success rate without this tile

79%

task.mdevals/scenario-2/

Babel Plugin Loader

Build a utility that loads Babel plugins and presets by name, demonstrating understanding of Babel's plugin resolution system.

Requirements

Create a module that accepts plugin or preset names and loads them using Babel's configuration system. The module should:

  1. Accept plugin or preset names in shorthand format (e.g., "transform-arrow-functions" or "preset-env")
  2. Load the plugins/presets using Babel's API
  3. Return whether each item loaded successfully
  4. Handle errors when items cannot be loaded

The utility should work with:

  • Plugin shorthand names (e.g., "transform-arrow-functions")
  • Preset shorthand names (e.g., "preset-env")
  • Scoped package names (e.g., "@babel/plugin-transform-arrow-functions")

Test Cases

  • Loading a standard Babel plugin by shorthand name returns the resolved plugin @test
  • Loading a Babel preset by shorthand name returns the resolved preset @test
  • Loading a scoped Babel plugin returns the correctly resolved plugin @test
  • Attempting to load a non-existent plugin returns an error @test

Implementation

@generates

API

/**
 * Loads and validates Babel plugins and presets
 *
 * @param {Array<string>} names - Array of plugin/preset names to load
 * @param {Object} options - Configuration options
 * @param {string} options.type - Either 'plugin' or 'preset'
 * @returns {Array<Object>} Array of results with { name, resolved, loaded, error }
 */
function loadBabelPlugins(names, options) {
  // IMPLEMENTATION HERE
}

module.exports = { loadBabelPlugins };

Dependencies { .dependencies }

@babel/core { .dependency }

Provides the core Babel transformation and plugin loading functionality.

@satisfied-by