T
T
tonybeat2016-04-18 18:20:49
JavaScript
tonybeat, 2016-04-18 18:20:49

How to properly minify css?

gulp.task('default', function() {
    return gulp.src('css/*.css')
        .pipe(concat('all.css'))
        .pipe(minifyCSS())
        .pipe(rename('all.min.css'))
        .pipe(gulp.dest('dist/css/'));
});

2 files appear in the dist / css folder: all.css and all.min.js
but for some reason in the future when saving css, only min.css is updated,
I need to update the full file and then minify
how to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Serj-One, 2016-04-18
@tonybeat

The min is updated because you only save min.

gulp.task('default', function() {
    return gulp.src('css/*.css')
        .pipe(concat('all.css'))
        .pipe(gulp.dest('dist/css/'));
        .pipe(minifyCSS())
        .pipe(rename('all.min.css'))
        .pipe(gulp.dest('dist/css/'));
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question