Labanino
Labanino

Reputation: 3960

Gulp is creating a directory instead of a file

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.

Upvotes: 2

Views: 424

Answers (1)

dudeman
dudeman

Reputation: 603

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.

Upvotes: 5

Related Questions