Registry / devops / broccoli-babel-transpiler

broccoli-babel-transpiler

JSON →
library8.0.2jsnpmunverified

A Broccoli plugin for transpiling ES6+ to readable ES5 using Babel, with caching and parallelization. Current stable version 8.0.2 supports Node 16+ and 18+ and requires @babel/core >=7.17.9 as a peer dependency. Key differentiators include persistent caching across rebuilds (via cacheKey/cacheKeyPlugin methods) and async plugin support since v8.0.1. Notable breaking changes in v8 include dropping Node 14 and moving @babel/core to peer deps. Commonly used in Ember.js and other Broccoli-based build pipelines.

npm install broccoli-babel-transpiler
INSTALL
IMPORT
SIG · BROCCOLI-BABEL-TRA
B
broccoli-babel-transpiler
devopsjavascriptv8.0.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const babel = require('broccoli-babel-transpiler');
import babel from 'broccoli-babel-transpiler';
Package is CJS-only; default export is the plugin function. ESM import may fail or require .default.
BabelPlugin
class MyPlugin { cacheKey() { return 'myplugin-cachekey'; } }
Plugin authors must implement cacheKey() to enable caching. This is an informal interface, not a base class.

Shows how to use broccoli-babel-transpiler with a Brocfile-like setup: funnel source files, transpile via babel with preset-env targeting modern browsers, then build with Broccoli.

const babel = require('broccoli-babel-transpiler'); const broccoli = require('broccoli'); const funnel = require('broccoli-funnel'); // Create a tree of JavaScript files const appTree = funnel('src', { include: ['**/*.js'] }); // Transpile with babel const transpiled = babel(appTree, { presets: [ ['@babel/preset-env', { targets: { browsers: ['last 2 versions'] } }] ] }); // Build the output const builder = new broccoli.Builder(transpiled); builder.build().then(() => { console.log('Build complete!'); }).catch(err => console.error(err));
Debug
Known issues
breakingSince v8.0.0, @babel/core is no longer bundled; it must be installed as a peer dependency.
fix
Install @babel/core explicitly in your project: npm install --save-dev @babel/core
affects: >=8.0.0
breakingNode 14 support dropped in v8.0.0.
fix
Upgrade to Node 16 or 18.
affects: >=8.0.0
gotchaEmpty options will not transpile anything; you must specify presets or plugins explicitly.
fix
Provide a presets or plugins array in the Babel options.
affects: >=6.0.0
gotchaPlugin caching requires implementing cacheKey() method on the plugin; otherwise, the plugin's effect is not cached and may cause unnecessary rebuilds.
fix
Define a cacheKey() method that returns a string uniquely representing plugin configuration.
affects: *
Errors
Common errors & fixes
Cannot find module '@babel/core'
@babel/core is not installed because it moved to peerDependencies in v8.
fix
npm install --save-dev @babel/core
TypeError: babel is not a function
Using ES module import (import babel from '...') on a CJS package.
fix
Use require('broccoli-babel-transpiler') instead.
Upgrade
Version history
8.0.2latest on npm
Audit
Dependencies
@babel/corerequiredPeer dependency since v8.0.0; required for all transpilation
broccoli-pluginrequiredBase class for Broccoli plugins
workerpoolrequiredUsed for parallelizing transpilation across workers
Agent activity
20 hits · last 30 days
node
16
OpenAI (training)
1
Resources
broccoli-babel-transpiler — npm install broccoli-babel-transpiler · libregistry