2

I want gulp to spit out a style.min.css:

// Minify
gulp.task('minify-css', function () {
    gulp.src('css/style.css')
        .pipe(cleanCSS())
        .pipe(gulp.dest('css/style.min.css'))
});

it is minifying the .css but instead is creating a directory with a style.css in it:

css/style.min.css/style.css

Any help? Thanks.

Labanino
  • 3,902
  • 9
  • 33
  • 51

1 Answers1

5

gulp.dest writes to directories. You should add a rename step before piping to gulp.dest.

.pipe(rename('style.min.css'))
.pipe(gulp.dest('css/'))

You should be able to use the gulp-rename module for this.

pushkin
  • 9,575
  • 15
  • 51
  • 95
dudeman
  • 503
  • 3
  • 11