Gulp 4: gulp.lastRun() incremental builds versus full re-runs for large projects
0 reputation · 10 Feb 2023, 00:30 UTC
Goal: Choose between incremental and full re-runs for a Gulp 4 build that processes a large TypeScript source tree.
Constraint: Faster rebuilds are needed, but outputs must not go stale when non-globbed inputs such as tsconfig.json or imported templates change.
Uncertainty: gulp.lastRun(task) with gulp.src({ since }) limits processing to files changed since the last successful task run, while omitting since processes every matched file every run. The trade-off is I/O savings against missed dependencies outside the glob and stale dist files after deletions.
Does gulp.lastRun() reliably cover config files outside the gulp.src glob when they affect task output?
Should the build use incremental since filtering for every task or reserve full re-runs for config-dependent tasks?