Skip to content
  • home
  • portfolio
  • web design journal
  • blog
    • adventure
    • san diego
    • projects
    • website design
    • code notes
Blog Web Dev Gulp Minify Javascript

Gulp Minify Javascript

By Forrest Smith - Drempd.com

This will put a copy of the minified js file in the same folder in which it was found.

It will require the following: useref, gulpif

gulp.task('jsminify', function() {

  return gulp.src([

    "!node_modules/**/*.js",

    "**/wp-content/themes/**/*.js",

    "!**/**.min.js"

  ], { base: "./" })

  .pipe(useref())

  .pipe(gulpIf('*.js', uglify()))

  .pipe(rename({suffix: '.min'}))

  .pipe(gulp.dest('./'));

});

Posted on December 8, 2022August 27, 2025 in Web Dev

drempd | san diego, ca


home contact

adventures san diego projects stream sometimes weeklies website design

portfolio resume san diego web design freelance web designer

custom web design responsive web design website maintenance