I'm trying to filter out lines from all .js source files, and put into a separate file. (Specifically, I'm trying to grep all calls to a string translation function and post-process them).
I think I have the different parts figured out but can't make them fit together.
- For each file, process it
- Write each file's grep:ed lines to output.
- Append the result to a file
I've tried to through.push(<output per file>)
from the plugin, but the following step expects a file, not a string.
From there, I expect I could do something like gulp-concat or stream merge on the results and pipe it on to gulp.dist
, but there's bit missing here.
I figured out a way - simply replace the Vinyl file's
content
with the lines to output, and push that through tothrough.push
.