Нашел решениеvar insert = require('gulp-insert');
var rename = require("gulp-rename");
require('./html-concat-all');
module.exports = function (buildOptions) {
return gulp.task('html_path_to_json', ['html_concat_all'], function (cb) {
var src_contents = '{"src" : [';
return fsvinyl.src('./dev/*/index.html')
.pipe(insert.transform(function(contents, file) {
var regExp = /\[path-file\] ([A-Za-z0-9\-\_]+\/[A-Za-z0-9\-\_]+)/gim; // upd: добавил регулярку
var file_content = contents;
var str = file_content;
var re = regExp;
var res;
while ( (res = re.exec(str)) != null) {
gutil.log("result " + res[1]);
src_contents = src_contents + '"./markup/' + res[1] + '/*.{scss,sass,less,css}",';
}
src_contents = src_contents + '"!./**/_*.{scss,sass,less,css}"] }';
return src_contents;
}))
.pipe(rename(function (path) {
path.basename = "path_modules";
path.extname = ".json"
}))
.pipe(gulp.dest('./dev/'));
});
};