question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When using lastRun new files are skipped

See original GitHub issue

What were you expecting to happen?

src should detect newly added files

What actually happened?

images task is running after new file is added, but nothing is copied to build, task is working properly only on changed files (for example changing the resolution of the image and save it). It also works on first run.

screen shot 2018-12-21 at 15 21 38

Please post a sample of your gulpfile (preferably reduced to just the bit that’s not working)

Example from documentation:

const { src, dest, lastRun, watch } = require('gulp');
const imagemin = require('gulp-imagemin');

function images() {
  return src('src/images/**/*.jpg', { since: lastRun(images) })
    .pipe(imagemin())
    .pipe(dest('build/img/'));
}

function watch() {
  watch('src/images/**/*.jpg', images);
}

exports.watch = watch;

What version of gulp are you using?

4

What versions of npm and node are you using?

6.5.0, 11.1.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
phatedcommented, Dec 21, 2018

@max-ci until now we’ve treated your use case as an edge case for last run because it’s variable whether someone desires a copied file to be passed through. We’ve actually had a discussion on this same issue previously at https://github.com/gulpjs/vinyl-fs/issues/226 without a resolution.

since takes a function that receives each file and returns a timestamp, so you can also do custom logic if you’d like. If that solution doesn’t work for you, maybe the case is too specialized and you might need to reach for another module/plugin.

0reactions
3cpcommented, Dec 11, 2019

@phated ideally should not since check both mtime and ctime (in order to cater newly created file through copy/paste)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I tell gulp to skip files it's already processed?
Use Gulp's lastRun() in combination with Gulp src 's option since() , no external dependencies needed. const gulp = require('gulp ...
Read more >
dbms_scheduler.file_watch will only pull in files with t/s >= last ...
I am new to using the file_watcher in the dbms_scheduler so I ... WILL ONLY Pull files that are modified/created AFTER the last...
Read more >
Mover reports - Migrate to Microsoft 365
Skipped files and folders​​ When files and folders are "skipped," Mover has deliberately skipped that item during the transfer. Typically, items ...
Read more >
Logstash skip records by adding latest updated record date in ...
Everything is working fine but I've stuck with :sql_last_value. ... records by adding latest updated record date in last run metadata file.
Read more >
"Skip Duplicate Files" property enabled in Mass Ingestion ...
ERROR: "Skip Duplicate Files" property enabled in Mass Ingestion tasks does not process files failed in last run at target in IICS CDI ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found