CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-babel--plugin-transform-parameters

Babel plugin that compiles ES2015 default and rest parameters to ES5-compatible code

91

1.02x
Overview
Eval results
Files

task.mdevals/scenario-8/

Auto-Compilation Setup

Build a utility that enables automatic on-the-fly compilation of modern JavaScript files when they are required in Node.js, allowing the use of latest JavaScript features without a separate build step.

Requirements

Create a setup module that:

  1. Configures automatic compilation for .js files containing modern JavaScript syntax
  2. Enables source map support for accurate error stack traces
  3. Filters compilation to only include files in src/ and lib/ directories while ignoring node_modules/
  4. Works seamlessly when required before loading other modules

Create a demonstration that imports the setup and then loads a module using modern syntax.

Test Cases

  • A module with arrow functions is compiled and executed correctly @test
  • A module with template literals is compiled and executed correctly @test
  • Files in node_modules directory are not compiled @test
  • Source maps are enabled for debugging @test

Dependencies { .dependencies }

@babel/register { .dependency }

Provides on-the-fly compilation hooks for Node.js require system.

@babel/preset-env { .dependency }

Provides presets for transforming modern JavaScript to compatible versions.

source-map-support { .dependency }

Provides source map support for stack traces.

Expected Behavior

The setup module should register compilation hooks that:

  • Automatically transpile modern JavaScript syntax when files are required
  • Apply source map support for debugging
  • Only process files matching the configured patterns
  • Work transparently without affecting module functionality

@generates

Install with Tessl CLI

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

tile.json