How to tell Gulp to skip or ignore some files in gulp.src([…])?

后端 未结 2 1757
[愿得一人]
[愿得一人] 2021-01-07 16:23

How can I tell Gulp to skip or ignore some files in gulp.src([...])? For instance, I don\'t want to compress and concat this file in my css/ fo

相关标签:
2条回答
  • 2021-01-07 17:24

    Add a !:

    gulp.task('styles', function() {
      gulp.src([
          '!css/ignnore.css', // <== !
          'css/*.css'
        ])
        .pipe(concat('styles.css'))
        .pipe(autoprefix('last 2 versions'))
        .pipe(minifyCss())
        .pipe(gulp.dest('local/view/style/base/css/dist/'));
    });
    
    0 讨论(0)
  • 2021-01-07 17:29

    Try this:

    gulp.src(['css/**/!(ignore.css)*.css'])
    
    0 讨论(0)
提交回复
热议问题