Last 12 weeks · 0 commits
4 of 6 standards met
Hi, It took me a while to track down the culprit, but gulp-changed v5.0.3 is the reason my workflows doesn't work anymore. Reverting back to v5.0.2 fixes my bug. Since v5.0.3, all files, instead of only edited ones, are synchronzed. Here is my gulp code: The watch gulp is pretty standard for gulp 5:
The built in compareLastModifiedTime didn't work for me. On Windows the mtime of a file is rounded to seconds. Images created by people on a Mac, on the project I'm working on, have mliliseconds. When my task runs its creates the target file, and rounds milliseconds off. Subsequent runs it doesn't realize the source hasn't changed. For example here is the source and target mtimes it was seeing. 1446818873134 > 1446818873000 Below is the method I used: (NOTE: The bitwise math below is to round the float to an int. It's the quickest way according to: http://jsperf.com/math-floor-vs-math-round-vs-parseint/2) Thanks, David
Repository: sindresorhus/gulp-changed. Description: Only pass through changed files Stars: 739, Forks: 43. Primary language: JavaScript. Languages: JavaScript (100%), CoffeeScript (0%). License: MIT. Topics: gulp-plugin, javascript, nodejs. Latest release: v5.0.4 (9mo ago). Open PRs: 0, open issues: 0. Last activity: 9mo ago. Community health: 71%. Top contributors: sindresorhus, appleboy, mikaelbr, milang, alexgorbatchev, gavinaiken, platy11, generalov, daviskoh, Richienb and others.