Babel's modular runtime helpers that provide transpilation support for modern JavaScript features
94
Build a Babel plugin that tracks transformations and modifies parsing behavior based on configuration.
Your plugin should:
trackStats (boolean) that enables/disables statistics trackingtrackStats is enabled, attach the statistics to the result metadata under the key transformStats{ transformStats: { functionDeclarations: 2, arrowFunctions: 3 } } @test<div>Hello</div>), the plugin should successfully parse and transform it without errors @test@generates
/**
* Babel plugin that tracks transformation statistics and enables JSX parsing
*
* @param {object} api - The Babel API object
* @param {object} options - Plugin options
* @param {boolean} options.trackStats - Whether to track and report statistics
* @returns {object} Plugin object with visitor and lifecycle methods
*/
module.exports = function customPlugin(api, options) {
// Plugin implementation
};Provides the Babel transformation API and plugin infrastructure.
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