Let's say I want to replace the version number in a bunch of files, many of which live in subdirectories. I will pipe the files through gulp-replace to run the regex-replace function; but I will ultimately want to overwrite all the original files.
The task might look something like this:
gulp.src([
'./bower.json',
'./package.json',
'./docs/content/data.yml',
/* ...and so on... */
])
.pipe(replace(/* ...replacement... */))
.pipe(gulp.dest(/* I DONT KNOW */);
So how can I end it so that each src
file just overwrites itself, at its original location? Is there something I can pass to gulp.dest()
that will do this?
.json
files? or plaintext? you could could rungulp.src(<one file>)...
for each file you want to change.gulp.src()
for every individual file and piping each one through its own regex-replace that is in fact the same. I'd like to use an array of globbing patterns, instead.gulp-if
to achieve something, but as long as the source files aren't in the same folder i don't think you could achieve this in one call.