1.0.2 • Published 6 years ago

gulp-source-exists v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Gulp Source Exists

Report back if any files are not found in the src glob.

Installation

npm i gulp-source-exists --save-dev

Setup

const sourceExists = require('gulp-source-exists')

Usage

Simply pass in the same array of source files into the sourceExists function to check if all the files exist.

Special cases where ignored files (!) or globs are used will not be checked. Only full file paths relative to where the gulpfile is located.

The sourceExists function accepts a second boolean parameter. If set to true, an error will be thrown if a file doesn't exist. Causing the task to fail completely.

gulp.task('scripts', () => {

  let files = [
    "modules/scripts/file.js",
    "public/assets/js/gallery.js",
    "public/assets/js/inits.js",
    "public/assets/js/*/**.js"
  ]

  return gulp.src(files)
  .pipe(sourceExists(files))
  .pipe(gulp.dest("combined.js"))
});
1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago