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-7/

Configuration File Loader Tool

Build a utility that loads and displays Babel configuration information from a JavaScript project.

Requirements

Your tool should:

  1. Accept a directory path as input
  2. Load the Babel configuration for that directory
  3. Display information about the configuration, including:
    • Whether a configuration file was found
    • The path to any configuration files discovered
    • The list of plugins configured
    • The list of presets configured
  4. Handle cases where no configuration exists gracefully
  5. Export a function loadBabelConfig(dirPath) that returns an object with the configuration details

Output Format

The function should return an object with this structure:

{
  hasConfig: boolean,        // true if config was found
  configFiles: string[],     // array of config file paths found
  plugins: string[],         // array of plugin names
  presets: string[]         // array of preset names
}

If no configuration is found, return an object with hasConfig: false and empty arrays for the other fields.

Test Cases

  • Loading config from a directory with babel.config.js returns correct plugin and preset names @test
  • Loading config from a directory with .babelrc returns correct configuration details @test
  • Loading config from a directory without Babel config returns hasConfig: false @test
  • Config loading handles the package.json "babel" field correctly @test

Implementation

@generates

API

/**
 * Loads Babel configuration from a directory
 *
 * @param {string} dirPath - The directory path to load config from
 * @returns {Promise<Object>} Configuration details including hasConfig, configFiles, plugins, presets
 */
async function loadBabelConfig(dirPath) {
  // Implementation here
}

module.exports = { loadBabelConfig };

Dependencies { .dependencies }

@babel/core { .dependency }

Provides Babel configuration loading and transformation capabilities.