taptapship / wiredep

Wire Bower dependencies to your source code.
MIT License
1.15k stars 142 forks source link

Log which file changed with Gulp #151

Open adammockor opened 9 years ago

adammockor commented 9 years ago

Is it possible to do that? I got task like below, but it logs all files in stream instead of only files, which changed.

//to jade
gulp.src('app/views/layouts/*.jade')
 .pipe(wiredep({
    exclude: ['bootstrap-sass-official', 'modernizr'],
    ignorePath: '../../',
    overides: {},
    onFileUpdated: function(file) {
      console.log(file);
    }
  }))
  .pipe(gulp.dest('app/views/layouts'));
CWSpear commented 9 years ago

Why would you expect only files that changed to trigger?

adammockor commented 9 years ago

Because of the logging of the changes. Grunt-wiredep has this functionality.

stephenplusplus commented 9 years ago

onFileUpdated is called for every file, even if it wasn't changed?

(please forgive my delay!)

adammockor commented 9 years ago

In my experience yes. (please forgive my delay!)

stephenplusplus commented 9 years ago

Oh man, we are full of delays. Sorry for this one, too :(

In non-stream mode, here's how we're detecting if we need to write new content :

https://github.com/taptapship/wiredep/blob/571d46975b4a8b0aa038b3b320c7970e97f537a7/lib/inject-dependencies.js#L127

Maybe we should do something similar for the stream mode:

https://github.com/taptapship/wiredep/blob/571d46975b4a8b0aa038b3b320c7970e97f537a7/lib/inject-dependencies.js#L144

stephenplusplus commented 9 years ago

PR welcome!

CWSpear commented 9 years ago

Can I just say: Thank you for linking to specific commits (tag would have been okay, too) and not master?

stephenplusplus commented 9 years ago

:) So important to remember to do that, but I most often forget. For anyone who doesn't know already, select a line as normal, then press y to get a specific URL generated.

CWSpear commented 9 years ago

Whoa, I didn't know that trick! I always just navigated to the commit/tag. Very nice trick!

eddiemonge commented 8 years ago

that sounds like a bug then since if a file wasn't updated then it shouldn't trigger that event