gulp-haschanged-deps-async

0.0.4 • Public • Published

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

Package Sidebar

Install

npm i gulp-haschanged-deps-async

Weekly Downloads

1

Version

0.0.4

License

MIT

Unpacked Size

183 kB

Total Files

9

Last publish

Collaborators

  • niftylettuce
  • titanism