gobble-babel
raw JSON → 6.0.0 verified Sat Apr 25 auth: no javascript maintenance
A Gobble plugin to compile ES6/ES2015+ JavaScript files using Babel. Version 6.0.0 is the latest stable release; this package is part of the Gobble build system ecosystem. It automatically generates sourcemaps and passes user-specified options directly to Babel. Unlike standalone Babel CLI or other build tool plugins, it integrates tightly with Gobble's transform pipeline. Development is minimal; the package is in maintenance mode.
Common errors
error Error: Cannot find module 'babel-preset-es2015' ↓
cause Missing required Babel preset for ES2015 compilation.
fix
Run: npm install --save-dev babel-preset-es2015
error TypeError: gobble(...).transform is not a function ↓
cause gobble-babel not installed or not loaded; the 'babel' transform is not registered.
fix
Install gobble-babel as a dev dependency: npm install --save-dev gobble-babel
Warnings
breaking gobble-babel v6 is compatible with Babel 6, but not with Babel 5 or earlier. ↓
fix Ensure you install babel-preset-es2015 and babel-core version 6.x.
deprecated The 'babel' string used in gobble's transform method is specific to this plugin. If you switch to another plugin, the transform name changes. ↓
fix Use the correct transform name for your chosen plugin.
gotcha Sourcemaps are enabled by default; to disable them, pass `sourceMap: false` in options. ↓
fix Add sourceMap: false to the options object if sourcemaps cause issues.
Install
npm install gobble-babel yarn add gobble-babel pnpm add gobble-babel Imports
- default transform function wrong
const gobble = require('gobble'); module.exports = gobble('src').transform('babel', options);correctimport gobble from 'gobble'; gobble('src').transform('babel', options);
Quickstart
// gobblefile.js
const gobble = require('gobble');
module.exports = gobble('src').transform('babel', {
presets: ['es2015']
});