Skip to content

Instantly share code, notes, and snippets.

@webarthur
Last active July 25, 2016 18:42
Show Gist options
  • Save webarthur/a64a69a495834f41de210453530cd19e to your computer and use it in GitHub Desktop.
Save webarthur/a64a69a495834f41de210453530cd19e to your computer and use it in GitHub Desktop.
gulp-file-include, exemplo avançado
var gulp = require('gulp')
, markdown = require('markdown')
, fileinclude = require('gulp-file-include');
// importa json para variável
var app = require('./package.json')
// task principal
gulp.task('default', function() {
gulp.src(['index.html'])
.pipe(fileinclude({
filters: {
markdown: markdown.parse
context: {
variavelCustomizada: app.name,
comQualquerNome: app.version
}
}
}))
.pipe(gulp.dest('./'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment