Gulp plugin for minifying ES6+ code using Terser. Version 2.1.0, stable, maintained. Provides a drop-in replacement for gulp-uglify for modern JavaScript. Supports all Terser options, sourcemaps, and custom minifiers. Active development with regular updates. Differentiator: works with ES6+ syntax out of the box, unlike gulp-uglify which requires babel.
npm install gulp-terserNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic gulp-terser setup with options to drop console logs during minification.
Wrap all options in a single object: terser({ keep_fnames: true }).Add .pipe(sourcemaps.init()) before .pipe(terser()) and .pipe(sourcemaps.write()) after.
Upgrade Node to >=10 or use gulp-terser v1.x.
Pass empty object for options if not needed: gulpTerser({}, customMinifier).Run npm install --save-dev gulp-terser in your project directory.
Use const terser = require('gulp-terser'); or import terser from 'gulp-terser'; correctly.Pass terser.minify as the second argument, not terser itself.