Answer the question
In order to leave comments, you need to log in
Gulp, how to remove a file from processing?
I can not remove the file from processing, when minifying CSS, when the task is launched, *.min.min.css files are re-created, etc. if you run the task again.
Please help solve this problem.
const config = {
root: './project/app/',
html: {
watch: 'html/**/*.html',
src: 'html/*.html',
dest: 'html'
},
css: {
watch: 'css/**/*.css',
src: 'css/*.css',
dest: 'css'
},
gulp.task('css-min', ['less'], function () {
return gulp.src([config.root + config.css.dest + '/*.css' , !config.root + config.css.dest + '/*.min.css']) // Выбираем файл для минификации
.pipe(sourcemaps.init()) // Создаем карту стилей
.pipe(gcmq()) // Группирум медиазапросы
.pipe(cssnano()) // Сжимаем
.pipe(sourcemaps.write('.')) // Завершили создание карты CSS
.pipe(rename({
suffix: '.min'
})) // Добавляем суффикс .min
.pipe(gulp.dest(config.root + config.css.dest)); // Выгружаем в папку app/css
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question