-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
var inline = require('gulp-inline')
var processedContent = inline.sync(content, baseUrl, options);
//or
var processedVinylFile = inline.sync(vinylFile, options);It is useful for some situation. F.e. if I processindex.html I don't need to create a stream for a single file
function buildProject(options) {
function transform(file, enc, callback) {
//Transform each .js/.css/.html file
}
function flush(callback) {
//It is more comfortable then use gulp.src(indexPath).pipe(inline()).pipe(someCompileFn())
var indexContent = fs.readFileSync(path.join(options.baseUrl, 'index.html'));
var compiledIndex = new gutil.File({
path: newIndexPath,
contents: new Buffer(inline.sync(indexContent , options.baseUrl), 'utf8');
})
this.push(compiledIndex);
}
return through.obj(transform, flush)
}Metadata
Metadata
Assignees
Labels
No labels