{"id":20078,"library":"gulp-babel-helpers","title":"gulp-babel-external-helpers","description":"A gulp plugin that replaces gulp-babel by transpiling files with Babel while automatically collecting external helpers into a separate module. Version 2.2.2 is the latest stable release, with sporadic updates. It avoids polluting the global scope with babel helpers by generating a shared helpers file and injecting require statements into each transpiled file. Unlike gulp-babel or manual babel setup, it automates external helper management without global pollution.","status":"maintenance","version":"2.2.2","language":"javascript","source_language":"en","source_url":"https://github.com/jquense/gulp-babel-helpers","tags":["javascript"],"install":[{"cmd":"npm install gulp-babel-helpers","lang":"bash","label":"npm"},{"cmd":"yarn add gulp-babel-helpers","lang":"bash","label":"yarn"},{"cmd":"pnpm add gulp-babel-helpers","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Gulp plugin interface dependency","package":"gulp","optional":false},{"reason":"Transpilation core","package":"@babel/core","optional":false},{"reason":"Extracting external helpers","package":"@babel/helpers","optional":false},{"reason":"Stream transformation","package":"through2","optional":true}],"imports":[{"note":"ESM default export; the package does not export named symbols","wrong":"const babelHelpers = require('gulp-babel-helpers')","symbol":"babelHelpers","correct":"import babelHelpers from 'gulp-babel-helpers'"},{"note":"Common mistake: trying to destructure a non-existent named export","wrong":"const { babelHelpers } = require('gulp-babel-helpers')","symbol":"babelHelpers (as transform)","correct":"import babelHelpers from 'gulp-babel-helpers'; const transform = babelHelpers;"},{"note":"In CJS, default export is on .default in some Node versions; use the fallback pattern","wrong":"const babelHelpers = require('gulp-babel-helpers')","symbol":"Require in CommonJS","correct":"const babelHelpers = require('gulp-babel-helpers').default || require('gulp-babel-helpers')"}],"quickstart":{"code":"import gulp from 'gulp';\nimport babelHelpers from 'gulp-babel-helpers';\n\ngulp.task('scripts', () => {\n  return gulp.src('./src/**/*.js')\n    .pipe(babelHelpers(\n      {\n        presets: ['@babel/preset-env'],\n        plugins: ['@babel/plugin-transform-runtime']\n      },\n      './helpers.js'\n    ))\n    .pipe(gulp.dest('./dist'));\n});\n","lang":"typescript","description":"Transpile JavaScript files with Babel and collect external helpers into a separate helpers.js file."},"warnings":[{"fix":"Ensure the second argument is a relative path from the source root, e.g., './helpers.js' for a file at src/helpers.js.","message":"The 'imaginaryLocationInSrc' parameter must be a relative path as if it existed in the source directory. Using an absolute path or incorrect relative path will cause broken require statements in the output.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Set '@babel/plugin-external-helpers' or 'externalHelpers: true' in your babel config.","message":"If the babel config does not include 'externalHelpers: true' or the necessary plugins, helpers may not be extracted correctly.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Switch to gulp-babel + babel-plugin-external-helpers or a more modern setup.","message":"Package is no longer actively maintained; consider using '@babel/preset-env' with 'useBuiltIns' or 'babel-plugin-external-helpers' directly with gulp-babel.","severity":"deprecated","affected_versions":">=2.2.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install gulp-babel-helpers --save-dev'","cause":"Package not installed or missing in node_modules","error":"Error: Cannot find module 'gulp-babel-helpers'"},{"fix":"Use 'import babelHelpers from ...' or 'const babelHelpers = require(...).default'","cause":"Incorrect import style (e.g., using destructured named import)","error":"TypeError: babelHelpers is not a function"},{"fix":"Add 'externalHelpers: true' to your babel config object","cause":"Missing externalHelpers configuration in babel options","error":"Error: Babel config must specify 'externalHelpers' option"},{"fix":"Ensure the second argument to babelHelpers matches the filename that will be created in the dest","cause":"Imaginary location path does not match the generated file stream","error":"Error: ENOENT: no such file or directory, open '.../helpers.js'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}