Last active
July 25, 2016 18:42
-
-
Save webarthur/a64a69a495834f41de210453530cd19e to your computer and use it in GitHub Desktop.
gulp-file-include, exemplo avançado
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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