Babel's modular runtime helpers that provide transpilation support for modern JavaScript features
94
Build a utility that loads and displays Babel configuration information from a JavaScript project.
Your tool should:
loadBabelConfig(dirPath) that returns an object with the configuration detailsThe 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.
babel.config.js returns correct plugin and preset names @test.babelrc returns correct configuration details @testhasConfig: false @testpackage.json "babel" field correctly @test@generates
/**
* 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 };Provides Babel configuration loading and transformation capabilities.
Install with Tessl CLI
npx tessl i tessl/npm-babel--runtimedocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10