Babel Preset Taskcluster

raw JSON →
3.0.0 verified Sat Apr 25 auth: no javascript maintenance

A Babel preset that transforms Taskcluster ES6+ code into backwards-compatible JavaScript for Node.js environments. The current stable version is 3.0.0. This package is part of the Taskcluster ecosystem and provides a standardized Babel configuration for Taskcluster projects. It is designed to target older Node.js versions (including Node 4) and includes common transforms like ES6 module syntax, arrow functions, and other modern JavaScript features. It is maintenance-focused and not actively updated for newer Babel versions or Node.js releases.

error Cannot find module 'babel-preset-taskcluster'
cause Preset not installed or incorrect version.
fix
Run npm install --save-dev babel-preset-taskcluster.
error Error: Plugin/Preset files are not allowed to export objects, only functions.
cause Using require() to import the preset instead of the preset name string.
fix
Use the preset name as a string, e.g., presets: ['babel-preset-taskcluster'].
deprecated This preset targets very old Node.js versions (Node 4). For modern Node.js >=10, consider using @babel/preset-env instead.
fix Switch to @babel/preset-env with target 'node: current' or specific Node versions.
gotcha The preset is designed specifically for Taskcluster projects. Using it outside that context may include unnecessary transforms.
fix Evaluate if Taskcluster-specific transforms are needed for your project.
gotcha This preset does not include polyfills. You must provide your own polyfills for features like Promises, Object.assign, etc.
fix Use core-js or @babel/polyfill (deprecated) in conjunction with this preset.
npm install babel-preset-taskcluster
yarn add babel-preset-taskcluster
pnpm add babel-preset-taskcluster

How to configure Babel to use the Taskcluster preset in a project.

// In babel.config.js
module.exports = {
  presets: ['babel-preset-taskcluster']
};