Skip to content

Provides a hasChanged function for use with gulp-changed to check mtimes of a file's ES6 imports, CommonJS `require`s, AMD dependencies, or Sass/Stylus imports.

Notifications You must be signed in to change notification settings

mattpowell/gulp-haschanged-deps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gulp-haschanged-deps

Comparator function for gulp-changed to determine if any of the dependencies for a js module (amd, commonjs, or es6), sass file, or stylus file has changed.

Example

var gulp = require('gulp');
var changed = require('gulp-changed');
var hasChangedDeps = require('gulp-haschanged-deps');

gulp.task('copy', function() {
  return gulp.src('public/lib/**/*')
    .pipe(changed('build/public/lib', {
      hasChanged: hasChangedDeps({
        allowMissingDeps: true
      })
    }))
    .pipe(gulp.dest('build/public/lib'));
});

The above example will only copy over files in public/lib if the file or any of it's dependencies are newer than the associated file in build/public/lib.

Options

  • Setting allowMissingDeps to true (the default) will skip missing dependencies, however, if it's set to false and a dependency cannot be found, an error will be thrown.
  • Setting precinct as an Object will be passed through to the Precinct library (which is what is doing all the heavy lifting behind the scenes). This can be helpful for setting a specific type of parser for finding dependencies. E.g. { precinct: { type: 'commonjs' } }.

License

MIT

About

Provides a hasChanged function for use with gulp-changed to check mtimes of a file's ES6 imports, CommonJS `require`s, AMD dependencies, or Sass/Stylus imports.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published