M
M
Maxim Maximov2018-09-30 11:04:12
gulp.js
Maxim Maximov, 2018-09-30 11:04:12

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

1 answer(s)
M
Mikhail Vlasov, 2018-09-30
@storm_uk

Maybe I'm wrong, but you have the same src and dest folders

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question