0

I'm trying to use gulp-jade-find-affected to rebuild with a watcher only the affected files. For example, if I do an update in a layout or mixin file, I want to rebuild only the files who includes the mixin.

But the example on the plugin's Github doesn't work since an update of gulp-watch (emitOnGlob option doesn't exist anymore).

After a research, I found this solution and I tried to adapt it for my case but it doesn't work :

 var gulp = require('gulp'),
watch = require('gulp-watch'),
fs = require('fs'),
jade = require("gulp-jade"),
affected = require('gulp-jade-find-affected');

var destJade = './docs/';

gulp.task('templates', function() {
     return gulp.src('src/fr_FR/pages/*.jade').pipe(watch('src/fr_FR/**/*.jade', function(files) {
        return files
          .pipe(affected())
          .pipe(jade({
            pretty: true,
            data: JSON.parse(fs.readFileSync('./src/fr_FR/data/data.json', 'utf8'))
          }))
          .pipe(gulp.dest(destJade));
    }));
});

If someone has any idea to do what I want, I'll really appreciate !

Thanks for your attention.

AshJS
  • 1
  • 1

1 Answers1

1

I'm the author of the gulp-jade-find-affected module. Thank you for your interest in the module. I've updated it (or actually only the instructions) to support cooperation with newest version of gulp-watch in v.0.2.0.

I found this thread by accident, so if you have any more issues with the module, it would be of great help if you could please create an issue on the github-repo. I'll then try to fix them as soon as possible.

Brian Frisch
  • 507
  • 2
  • 7