Here is the post I am following with no success.
Modify file in place (same dest) using Gulp.js and a globbing pattern
Here is my code
var fstrm = require('gulp');
var inlineCss = require('gulp-inline-css');
var rename = require("gulp-rename");
(function() {
fstrm.src("emails/**/index.html")
.pipe(inlineCss({}))
.pipe(rename("inline.html"))
.pipe(fstrm.dest("emails"));
}());
it finds all index.html in the subdirectories under emails/
and inlines the css (this I can confirm) but fails to write that file back in the same subdirectory from which the index.html came. Instead it writes them all to the emails directory overwriting the previous inline.html and leaving then just the last file to be processed.
I have tried every variation offered at that and the other post related to this question with no success. Has fileglob changed since? or gulp? I ran this using vinyl-fs instead of gulp and it's the same deal.