CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-babel-plugin-transform-eval

Babel plugin that transforms eval() calls containing string literals by parsing and compiling the string content at transform time

Overall
score

98%

Overview
Eval results
Files

task.mdevals/scenario-7/

Babel CLI Build Tool

A command-line tool that compiles JavaScript files using Babel with configurable options.

Capabilities

File Compilation

  • Compiles a single JavaScript file to an output directory @test
  • Compiles all JavaScript files from a source directory to an output directory @test
  • Copies non-JavaScript files (e.g., .json, .txt) from source to output directory when copy-files option is enabled @test

Source Map Generation

  • Generates inline source maps when the inline source-map option is enabled @test
  • Generates external source map files (.map) when the source-map option is enabled @test

File Filtering

  • Ignores files matching specified glob patterns during compilation @test
  • Only compiles files matching specified glob patterns @test

Watch Mode

  • Watches source files and automatically recompiles when changes are detected @test

Implementation

@generates

API

/**
 * Compiles JavaScript files using Babel with the specified options.
 *
 * @param {object} options - Compilation options
 * @param {string} options.srcDir - Source directory containing JavaScript files to compile
 * @param {string} options.outDir - Output directory for compiled files
 * @param {boolean} [options.sourceMaps] - Generate external source map files
 * @param {boolean} [options.inlineSourceMaps] - Generate inline source maps
 * @param {boolean} [options.copyFiles] - Copy non-JavaScript files to output directory
 * @param {string[]} [options.ignore] - Array of glob patterns for files to ignore
 * @param {string[]} [options.only] - Array of glob patterns for files to compile (if specified, only these are compiled)
 * @param {boolean} [options.watch] - Enable watch mode for automatic recompilation
 * @returns {Promise<void>} Resolves when compilation is complete (or watch mode is started)
 */
async function compile(options) {
  // IMPLEMENTATION HERE
}

module.exports = { compile };

Dependencies { .dependencies }

@babel/cli { .dependency }

Provides Babel command-line interface capabilities for file compilation, watch mode, and filtering.

@babel/core { .dependency }

Provides core Babel transformation APIs for compiling JavaScript code.

Install with Tessl CLI

npx tessl i tessl/npm-babel-plugin-transform-eval

tile.json