broccoli-6to5-transpiler (deprecated, part of broccoli-babel-transpiler)
raw JSON → 3.0.0 verified Fri May 01 auth: no javascript renamed
This package is deprecated. It was the Broccoli plugin for transpiling ES6 to ES5 using 6to5 (the original name of Babel). The project has been renamed and migrated to `broccoli-babel-transpiler`, which is actively maintained with the latest version v8.0.2 (January 2025). The current package (broccoli-6to5-transpiler) is archived and should not be used. Instead, use `broccoli-babel-transpiler` with `@babel/core` as a peer dependency. Key differentiator: it integrates Babel into the Broccoli build system, supporting Babel plugins and presets, but this deprecated version is incompatible with modern Babel (v7+).
Common errors
error Cannot find module '@babel/core' ↓
cause The package requires @babel/core as a peer dependency (since v8.0.0 of broccoli-babel-transpiler).
fix
Run: npm install --save-dev @babel/core
error Error: broccoli-6to5-transpiler is not a function ↓
cause The package 'broccoli-6to5-transpiler' is deprecated and may not be properly installed or the import is wrong.
fix
Use 'broccoli-babel-transpiler' instead: const transpile = require('broccoli-babel-transpiler');
error The 'blacklist' option is not supported in @babel/preset-env ↓
cause The old 6to5 'blacklist' option is no longer valid in Babel 7+.
fix
Use @babel/preset-env and configure 'exclude' if needed: presets: [['@babel/preset-env', { exclude: ['transform-classes'] }]]
error Cannot read property 'transpile' of undefined ↓
cause Using an incorrect import path or the package is not installed (misnamed).
fix
Ensure you have installed 'broccoli-babel-transpiler' and import it correctly.
Warnings
deprecated Package 'broccoli-6to5-transpiler' is renamed and deprecated in favor of 'broccoli-babel-transpiler'. npm registry shows no updates since 2015. ↓
fix Replace 'broccoli-6to5-transpiler' with 'broccoli-babel-transpiler' in package.json and update imports accordingly.
breaking 6to5 options (e.g., 'blacklist', 'optional') are not supported in Babel 7+. Using them will cause errors. ↓
fix Use Babel 7+ configuration: 'presets', 'plugins', 'targets' instead of 6to5-specific options.
breaking Since v8.0.0, @babel/core must be installed as a peer dependency. Missing it leads to 'Cannot find module @babel/core'. ↓
fix Install @babel/core: npm install --save-dev @babel/core
breaking Node.js 14 support is dropped in broccoli-babel-transpiler v8.0.0. The package may fail on Node 14. ↓
fix Update Node.js to version 16+ (or use v7.x of broccoli-babel-transpiler for Node 14 compatibility).
gotcha The package 'broccoli-6to5-transpiler' v3.0.0 is archived; its API and behavior are frozen. It does not support modern JavaScript features like async/await without additional plugins. ↓
fix Migrate to 'broccoli-babel-transpiler' and configure Babel presets appropriately for modern syntax.
Install
npm install broccoli-6to5-transpiler yarn add broccoli-6to5-transpiler pnpm add broccoli-6to5-transpiler Imports
- default wrong
const transpile = require('broccoli-6to5-transpiler');correctimport transpile from 'broccoli-babel-transpiler'; - BroccoliBabelTranspiler wrong
const BroccoliBabelTranspiler = require('broccoli-6to5-transpiler');correctimport BroccoliBabelTranspiler from 'broccoli-babel-transpiler'; - options wrong
const tree = require('broccoli-6to5-transpiler')('lib', { blacklist: ['es6.classes'] });correctimport transpile from 'broccoli-babel-transpiler'; const tree = transpile('lib', { presets: [['@babel/preset-env', { targets: { node: 'current' } }]] });
Quickstart
// Correct usage with broccoli-babel-transpiler (NOT the deprecated broccoli-6to5-transpiler)
// Brocfile.js
import { createBuilder, createWatcher } from 'broccoli';
import transpile from 'broccoli-babel-transpiler';
import funnel from 'broccoli-funnel';
const app = 'src';
const scripts = funnel(app, { include: ['**/*.js'] });
const transpiled = transpile(scripts, {
presets: [
['@babel/preset-env', {
targets: { browsers: ['last 2 versions'] },
modules: false
}]
]
});
const builder = createBuilder(transpiled);
// Export or use the builder as needed
export default transpiled;