{"id":20080,"library":"gulp-babel-minify","title":"gulp-babel-minify","description":"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.","status":"maintenance","version":"0.5.2","language":"javascript","source_language":"en","source_url":"https://github.com/babel/minify/tree/master/packages/gulp-babel-minify","tags":["javascript","babel-minify","babel-preset"],"install":[{"cmd":"npm install gulp-babel-minify","lang":"bash","label":"npm"},{"cmd":"yarn add gulp-babel-minify","lang":"bash","label":"yarn"},{"cmd":"pnpm add gulp-babel-minify","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: babel-minify uses Babel's plugin system.","package":"@babel/core","optional":false},{"reason":"The actual minification preset used by gulp-babel-minify.","package":"babel-preset-minify","optional":false}],"imports":[{"note":"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.","wrong":"import minify from 'gulp-babel-minify';","symbol":"gulpBabelMinify (default)","correct":"const minify = require('gulp-babel-minify');"},{"note":"No named export exists; the only export is the default function.","wrong":"import { minify } from 'gulp-babel-minify';","symbol":"minify function","correct":"const minify = require('gulp-babel-minify');"},{"note":"Custom babel and minifyPreset must be passed as the second argument (overrides object), not inside minifyOptions.","wrong":"const minify = require('gulp-babel-minify');\nconst options = { babel: customBabel };","symbol":"custom babel/minify preset","correct":"const minify = require('gulp-babel-minify');\nminify({ mangle: { keepClassName: true } }, { babel: customBabel, minifyPreset: customPreset });"}],"quickstart":{"code":"const gulp = require('gulp');\nconst minify = require('gulp-babel-minify');\n\ngulp.task('minify', () =>\n  gulp.src('./build/app.js')\n    .pipe(minify({\n      mangle: {\n        keepClassName: true\n      }\n    }))\n    .pipe(gulp.dest('./dist'))\n);","lang":"javascript","description":"Shows basic Gulp task using gulp-babel-minify with mangle options to minify a JavaScript file."},"warnings":[{"fix":"Switch to gulp-terser (npm install gulp-terser).","message":"The babel-minify project is no longer actively maintained. Last release 2018. Consider using gulp-terser or gulp-uglify instead.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Rename 'blacklist' to 'exclude' in mangle options.","message":"In version 0.3.0, the mangle option 'blacklist' was renamed to 'exclude'. Old code using 'blacklist' will break.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Upgrade @babel/core to v7 and update any Babel config (babelrc, presets) accordingly.","message":"In version 0.4.0, babel-minify switched from Babel 6 to Babel 7. Ensure @babel/core v7+ is installed as peer dependency.","severity":"breaking","affected_versions":">=0.4.0"},{"fix":"Ensure the 'comments' value is a Function, RegExp, or Boolean.","message":"The 'comments' override option last argument is a Function, RegExp, or Boolean. Using some other type may silently fail.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use: minify({}, { babel: customBabel, minifyPreset: customPreset })","message":"When using a custom babel or minifyPreset, they must be passed in the second 'overrides' argument, not inside the first options object.","severity":"gotcha","affected_versions":">=0.0.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 @babel/core --save-dev","cause":"@babel/core is a peer dependency not automatically installed.","error":"Error: Cannot find module '@babel/core'"},{"fix":"Run: npm install babel-preset-minify --save-dev","cause":"babel-preset-minify is a dependency of gulp-babel-minify but may not be installed if npm peer dependency resolution is strict.","error":"Error: Cannot find module 'babel-preset-minify'"},{"fix":"Use CommonJS require: const minify = require('gulp-babel-minify');","cause":"Importing using ESM (import minify from 'gulp-babel-minify') in an environment that expects CJS or missing default export.","error":"TypeError: gulpBabelMinify is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}