gulp-first
A Gulp plugin for passing through only the first object (source file) selected.
Used combination with gulp-newer
, this filter will emit only the first file object
if any of the files from a gulp.src(...)
glob are newer than the target. This can be useful with gulp-exec
for many:1 build tasks where some external tool needs to be invoked if the target is out-of-date.
npm install -D gulp-first
use (in a gulpfile)
var gulp = var newer = var first = var exec = var paths = src: "pom.xml" "src/**/*" "resources/**/*" "test/**/*" target: "target/antlr4-typescript-4.6-SNAPSHOT-complete.jar" gulp
This usage pattern will ensure that the mvn
command is executed only once, to generate the .jar file, no matter how many source files have changed.