coure2011
coure2011

Reputation: 42494

gulp-minify not working with gulp-rename

code:

var gulp = require('gulp');
var minify = require('gulp-minify');
var rename = require('gulp-rename');

gulp.task('compress', function() {
  gulp.src('script-source.js')
    .pipe(minify())
    .pipe(rename('script1.js'))
    .pipe(gulp.dest('.'));
});

in same folder it is creating a new file script1.js but its not compressed, its same copy..

Upvotes: -1

Views: 204

Answers (2)

dip
dip

Reputation: 1261

you forgot to add return statement in your gulp task.

Upvotes: 0

dkt
dkt

Reputation: 144

Using gulp-rename could be the choice https://github.com/hparra/gulp-rename For more detail https://github.com/gulpjs/gulp/issues/34

Upvotes: 0

Related Questions