Registry / devops / gulp-babel-globals

gulp-babel-globals

JSON →
library2.0.0jsnpmunverified

Gulp plugin for babel-globals that allows you to define global variable names for Babel modules during a Gulp build pipeline. Version 2.0.0 is the latest stable release, with no frequent updates. It wraps babel-globals (v2.x) to integrate with Gulp streams. Differentiators: it provides a Gulp-friendly API for handling ES6 module globals, which is useful for legacy builds or specific bundling needs. Alternatives include using Babel directly with custom plugins.

npm install gulp-babel-globals
INSTALL
IMPORT
SIG · GULP-BABEL-GLOBALS
G
gulp-babel-globals
devopsjavascriptv2.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import babelGlobals from 'gulp-babel-globals'
const babelGlobals = require('gulp-babel-globals')
CommonJS require works, but ESM import is preferred for modern projects
gulpBabelGlobals
import * as gulpBabelGlobals from 'gulp-babel-globals'
Namespace import to access all exports
default
const babelGlobals = require('gulp-babel-globals')
import { babelGlobals } from 'gulp-babel-globals'
The package exports a single function as default; named import will be undefined

Shows basic usage: pipe JavaScript files through gulp-babel-globals with options

const gulp = require('gulp'); const babelGlobals = require('gulp-babel-globals'); gulp.task('globals', () => { return gulp.src('src/**/*.js') .pipe(babelGlobals({ bundleFileName: 'myBundle.js' })) .pipe(gulp.dest('dist')); });
Debug
Known issues
gotchaThe plugin only processes files ending in .js; other extensions are ignored silently.
fix
Ensure input files have .js extension or configure gulp.src accordingly.
affects: >=2.0.0
deprecatedThe 'bundleFileName' option is required but not validated; missing it may cause errors.
fix
Always provide a 'bundleFileName' option in the options object.
affects: 2.0.0
gotchaThis plugin is not compatible with Babel 7+ because babel-globals has not been updated.
fix
Use an alternative approach for Babel 7 or higher, such as custom Gulp transforms.
affects: >=2.0.0
Errors
Common errors & fixes
Cannot find module 'babel-globals'
babel-globals is a peer dependency that must be installed separately.
fix
Run 'npm install babel-globals' alongside gulp-babel-globals.
TypeError: babelGlobals is not a function
Incorrect import: using named import instead of default import.
fix
Use 'const babelGlobals = require("gulp-babel-globals")' or 'import babelGlobals from "gulp-babel-globals"'.
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies
babel-globalsrequiredCore library that handles the actual module-to-global transformation
gulpoptionalPeer dependency for stream piping
Agent activity
4 hits · last 30 days
node
4
Resources
gulp-babel-globals — npm install gulp-babel-globals · libregistry