{"id":20037,"library":"fly-babel","title":"fly-babel","description":"Babel plugin for the Fly build system, version 2.1.1. It allows you to transpile ES6/ES2015+ code using Babel within Fly pipelines. The plugin supports standard Babel options (presets, plugins, sourceMaps, etc.) and a preload feature that automatically loads Babel plugins/presets from package.json. Release cadence is low; last release was in 2018. Key differentiator: tight integration with Fly, including preloading and simple generator-based task syntax. Requires Node >= 4.6 and Fly 2.0+.","status":"maintenance","version":"2.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/bucaran/fly-babel","tags":["javascript","fly","fly-plugin","babel","es6","compile","esnext","transpile","6to5"],"install":[{"cmd":"npm install fly-babel","lang":"bash","label":"npm"},{"cmd":"yarn add fly-babel","lang":"bash","label":"yarn"},{"cmd":"pnpm add fly-babel","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; requires Fly 2.0+ to mount plugin.","package":"fly","optional":false}],"imports":[{"note":"Plugin is mounted via Fly's system; user does not import directly. Instead, configure in .fly.js or flyfile.js.","wrong":"import flyBabel from 'fly-babel';","symbol":"fly-babel plugin","correct":"const flyBabel = require('fly-babel'); // used internally by Fly, no direct import in user code"},{"note":"Method is chained on Fly's source/target stream. Must be inside a generator function (function *).","wrong":"fly.source('src/**/*.js').babel().target();","symbol":".babel()","correct":"yield fly.source('src/**/*.js').babel({ presets: ['es2015'] }).target('dist/');"},{"note":"preload: true automatically loads Babel plugins/presets from package.json. Default false.","wrong":"yield fly.source('src/**/*.js').babel({ preload: false });","symbol":"options.preload","correct":"yield fly.source('src/**/*.js').babel({ preload: true }).target('dist/');"}],"quickstart":{"code":"// In your flyfile.js\nconst fly = require('fly');\n\nexport default function* (fly) {\n  yield fly.source('src/**/*.js')\n    .babel({\n      presets: ['@babel/preset-env'],\n      sourceMaps: 'inline'\n    })\n    .target('dist/');\n}","lang":"javascript","description":"Shows basic usage of fly-babel with Babel presets and source maps in a Fly task."},"warnings":[{"fix":"Upgrade Node to >=6.x, or use fly-babel@0.2.1 for Node 4.x support.","message":"Version 2.1.0 dropped Node 4.x support; requires Node >= 6.x.","severity":"breaking","affected_versions":">=2.1.0"},{"fix":"Consider migrating to modern build tools like Webpack, Rollup, or esbuild.","message":"This plugin is for the legacy Fly build system (flyjs). Fly is no longer maintained.","severity":"deprecated","affected_versions":"*"},{"fix":"Use 'function * (fly) { ... }' syntax. Promises are not supported.","message":"The .babel() method must be called inside a generator function (function *). Using async/await or regular functions will fail.","severity":"gotcha","affected_versions":"*"},{"fix":"Ensure packages are installed and named properly. For custom names, configure presets/plugins manually.","message":"preload: true only works if babel plugins/presets are listed in package.json under 'devDependencies' or 'dependencies' and named conventionally (e.g., 'babel-preset-*' or 'babel-plugin-*').","severity":"gotcha","affected_versions":"*"},{"fix":"Test source map output; consider using 'inline' or 'both' for simpler debugging.","message":"Source maps may not work correctly if the source is processed by multiple plugins (e.g., fly-clear or fly-concat).","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install --save-dev fly-babel` and ensure Fly is configured to load the plugin (e.g., via 'fly clear' or plugin registration).","cause":"fly-babel plugin not installed or not registered with Fly.","error":"TypeError: fly.source(...).babel is not a function"},{"fix":"Install the preset: `npm install --save-dev @babel/preset-env` (or babel-preset-es2015 for older Babel).","cause":"Required Babel preset not installed.","error":"Error: Couldn't find preset 'es2015' relative to directory"},{"fix":"Install and configure 'babel-plugin-transform-runtime' or include 'babel-polyfill' in your code.","cause":"Using ES6 generators (async/await) without proper Babel runtime polyfill.","error":"ReferenceError: regeneratorRuntime is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}