Registry / devops / gulp-babel-minify

gulp-babel-minify

JSON →
library0.5.2jsnpmunverified

Gulp plugin for babel-minify (formerly Babili), providing a seamless way to minify JavaScript files in a Gulp pipeline. Current stable version is 0.5.2 (2018-09-24), with no updates since then — the project is effectively in maintenance mode. It wraps babel-minify (babel-preset-minify) which uses Babel transforms for dead code elimination, constant folding, mangling, etc. Alternatives like gulp-terser or gulp-uglify are more actively maintained. Requires @babel/core as a peer dependency.

npm install gulp-babel-minify
INSTALL
IMPORT
SIG · GULP-BABEL-MINIFY
G
gulp-babel-minify
devopsjavascriptv0.5.2
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.

gulpBabelMinify (default)
const minify = require('gulp-babel-minify');
import minify from 'gulp-babel-minify';
Package does not ship ESM exports; use CommonJS require(). If using TypeScript, you may need to install @types/gulp-babel-minify (not available) or use a custom declaration.
minify function
const minify = require('gulp-babel-minify');
import { minify } from 'gulp-babel-minify';
No named export exists; the only export is the default function.
custom babel/minify preset
const minify = require('gulp-babel-minify'); minify({ mangle: { keepClassName: true } }, { babel: customBabel, minifyPreset: customPreset });
const minify = require('gulp-babel-minify'); const options = { babel: customBabel };
Custom babel and minifyPreset must be passed as the second argument (overrides object), not inside minifyOptions.

Shows basic Gulp task using gulp-babel-minify with mangle options to minify a JavaScript file.

const gulp = require('gulp'); const minify = require('gulp-babel-minify'); gulp.task('minify', () => gulp.src('./build/app.js') .pipe(minify({ mangle: { keepClassName: true } })) .pipe(gulp.dest('./dist')) );
Debug
Known issues
deprecatedThe babel-minify project is no longer actively maintained. Last release 2018. Consider using gulp-terser or gulp-uglify instead.
fix
Switch to gulp-terser (npm install gulp-terser).
affects: >=0.0.0
breakingIn version 0.3.0, the mangle option 'blacklist' was renamed to 'exclude'. Old code using 'blacklist' will break.
fix
Rename 'blacklist' to 'exclude' in mangle options.
affects: >=0.3.0
breakingIn version 0.4.0, babel-minify switched from Babel 6 to Babel 7. Ensure @babel/core v7+ is installed as peer dependency.
fix
Upgrade @babel/core to v7 and update any Babel config (babelrc, presets) accordingly.
affects: >=0.4.0
gotchaThe 'comments' override option last argument is a Function, RegExp, or Boolean. Using some other type may silently fail.
fix
Ensure the 'comments' value is a Function, RegExp, or Boolean.
affects: >=0.0.0
gotchaWhen using a custom babel or minifyPreset, they must be passed in the second 'overrides' argument, not inside the first options object.
fix
Use: minify({}, { babel: customBabel, minifyPreset: customPreset })
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module '@babel/core'
@babel/core is a peer dependency not automatically installed.
fix
Run: npm install @babel/core --save-dev
Error: Cannot find module 'babel-preset-minify'
babel-preset-minify is a dependency of gulp-babel-minify but may not be installed if npm peer dependency resolution is strict.
fix
Run: npm install babel-preset-minify --save-dev
TypeError: gulpBabelMinify is not a function
Importing using ESM (import minify from 'gulp-babel-minify') in an environment that expects CJS or missing default export.
fix
Use CommonJS require: const minify = require('gulp-babel-minify');
Upgrade
Version history
0.5.2latest on npm
Audit
Dependencies
@babel/corerequiredPeer dependency: babel-minify uses Babel's plugin system.
babel-preset-minifyrequiredThe actual minification preset used by gulp-babel-minify.
Agent activity
4 hits · last 30 days
node
4
Resources
gulp-babel-minify — npm install gulp-babel-minify · libregistry