Closed lybo closed 7 years ago
@lybo You can achieve this using event-stream without having to change the implementation of this plugin.
gulp.src -pipe-> transform_using__es_map -pipe-> this_plugin
@crissdev Thanks!
A snippet for the next developer who has the same issue:
var yaml = require('gulp-yaml');
var es = require('event-stream');
function contentTransformation() {
function transform(file, cb) {
file.contents = parseImports(file.contents);
cb(null, file);
}
return es.map(transform);
}
//snip....
gulp
.src([
'./configuration/*.yml'
])
.pipe(contentTransformation())
.pipe(yaml())
//snip....
Hi, Coin we add a parseContents function?
This function will be optional and it will manipulate the file contents.
The need of this manipulation of the content of an yaml file is for instance if you use https://www.npmjs.com/package/yaml-include-loader
I have cloned your repository and I have done this change. Then I did npm link to that one. It will be very handy for me if you include this option otherwise I can't use it with yaml-include-loader.
Example:
Implementation: