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.
Common errors
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.
Warnings
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.
Install
npm install broccoli-sabel yarn add broccoli-sabel pnpm add broccoli-sabel Imports
- sabel wrong
const sabel = require('broccoli-sabel')correctimport sabel from 'broccoli-sabel' - Sabel wrong
import { Sabel } from 'broccoli-sabel'correctimport Sabel from 'broccoli-sabel'
Quickstart
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;