10
10

More than 5 years have passed since last update.

gulpの基本機能で、除外ファイルを指定する

Posted at

「一括で処理するけど、これは書き出ししたくない。」というとき、gulp-ignoreなどのnpm moduleを使うのも良いですが、シンプルなものであれば基本機能でまかなうことができます。

!で除外

gulp.src(['client/*.js', '!client/b*.js'])

このように'! (エクスクラメーションマーク)'をつけることで該当するファイルを除外できます。

_で除外

また、このようにすることでも除外できます。

gulp.task('less', function() {
    return gulp.src('less/[^_]*.less')
    .pipe(less())
    .pipe(gulp.dest('assets/css'))
});
10
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
10