Skip to content

Latest commit

 

History

History
92 lines (66 loc) · 2.61 KB

README.md

File metadata and controls

92 lines (66 loc) · 2.61 KB

gulp-haschanged-deps-async

build status code coverage code style styled with prettier made with lass license

Provides a hasChanged function for use with gulp-changed to check mtimes of a file's dependencies.

This package is a modern and updated fork of gulp-haschanged-deps and as such I've retained the original author's licensing as it was inspired by his work.

Table of Contents

Install

npm:

npm install gulp-haschanged-deps-async

yarn:

yarn add gulp-haschanged-deps-async

Usage

const gulp = require('gulp');
const filter = require('gulp-custom-filter');
const hasChangedDepsAsync = require('gulp-haschanged-deps-async');
const less = require('gulp-less');

gulp.task('less', () => {
  return (
    gulp
      .src(['less/**/*.less'])
      .pipe(
        filter(
          hasChangedDepsAsync('css', {
            // the cwd option is for resolving paths to packages
            // and it defaults to the directory process is running from
            cwd: process.cwd(),
            // an optional extension you can pass if the file extension changes
            extension: '.css',
            // this is optional option, but useful for specifying directly
            // so that no auto-detection is required by `precinct`
            // <https://github.com/dependents/node-precinct>
            precinct: {
              type: 'less'
            }
          })
        )
      )
      .pipe(sourcemaps.init())
      .pipe(less())
      .pipe(sourcemaps.write('.'))
      .pipe(gulp.dest('css'))
  );
});

Contributors

Name Website
Nick Baugh http://niftylettuce.com/

License

MIT © Matt Powell