broccoli-sabel

raw JSON →
0.3.6 verified Fri May 01 auth: no javascript deprecated

Broccoli plugin for simple Babel transpilation (sabel is a lightweight Babel wrapper). Version 0.3.6 is the latest, but the package appears unmaintained (last release years ago). It provides a thin layer for running Babel transforms within Broccoli builds, but alternatives like broccoli-babel-transpiler or direct use of Babel are recommended for active support.

error Cannot find module 'babel-core'
cause babel-core is missing or not installed
fix
npm install --save-dev babel-core
error Error: Broccoli-sabel: Expected a string or object, got undefined
cause Missing options argument
fix
Call sabel('src', { presets: [] }) with options object.
deprecated Package is deprecated; use broccoli-babel-transpiler or @babel/core directly.
fix Replace with broccoli-babel-transpiler: npm install --save-dev broccoli-babel-transpiler
gotcha Requires babel-core (Babel 6) which is outdated; may not work with Babel 7+.
fix Use broccoli-babel-transpiler which supports Babel 7.
gotcha Only works within Broccoli build system; not standalone.
fix Ensure you are using Broccoli as your build tool.
npm install broccoli-sabel
yarn add broccoli-sabel
pnpm add broccoli-sabel

Creates a Broccoli tree that transpiles files in 'src' using Babel with @babel/preset-env and source maps.

import sabel from 'broccoli-sabel';
import { writeFileSync } from 'fs';

const tree = sabel('src', {
  presets: ['@babel/preset-env'],
  sourceMaps: true
});

// In Brocfile.js or similar, return tree
export default tree;