V
V
Vladimir Banduristov2018-09-20 13:36:07
css
Vladimir Banduristov, 2018-09-20 13:36:07

How to apply gulp-clean-css to a less+css stream?

In Gulp I did the following task:

gulp.task('css', function() {
    return streamqueue({ objectMode: true },
            gulp.src('src/css/*.css'),
            gulp.src('src/less/*.less')
            .pipe(less())
        )
        .pipe(prefix('last 2 versions'))
        .pipe(concat('production.min.css'))
        .pipe(cleanCSS({ level: 2 }))
        .pipe(gulp.dest('./dist/css'))
        .pipe(reload({ stream: true }))
});

And everything even works fine, but, with this approach, clean-css doesn’t use anything except minification, that is, for example, it doesn’t collect selectors with the same css properties.
How to make clean-css work fine for both less and css?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question