D
D
dhat2016-11-26 01:50:07
css
dhat, 2016-11-26 01:50:07

Why does the plugin create a semantic.min.css folder when Gulp is minified?

I minify the semantic.css file, I want the output to be semantic.min.css in the same folder. But Galp creates a folder called semantic.min.css and in it a file called semantic.css.

gulp.task('ms', function() {
  return gulp.src('public/css/semantic.css')
    .pipe(cleanCSS({compatibility: 'ie8'}))
    .pipe(gulp.dest('public/css/semantic.min.css'));
});

Where is the error in the path?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergei Nazarenko, 2016-11-26
@dhat

Well, the correct destination folder is indicated in dest and not the file name, here it is for you a folder and creates to rename the file, use gulp-rename

gulp.task('ms', function() {
  return gulp.src('public/css/semantic.css')
    .pipe(cleanCSS({compatibility: 'ie8'}))
    .pipe(rename({suffix: ".min"}))
    .pipe(gulp.dest('public/css'));
});

Z
zaxx784, 2016-11-26
@zaxx784

gulp.task('ms', function() {
return gulp.src('public/css/semantic.css')
.pipe(cleanCSS({compatibility: 'ie8'}))
.pipe(gulp.dest(public/ css/*.css));
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question