Last active
April 23, 2017 11:23
-
-
Save LoyEgor/3bd25ef3e417ec88b5eb1042b28d6a2c to your computer and use it in GitHub Desktop.
inject html settings
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
//install | |
//npm i gulp-inject group-array@0.3.1 | |
var inject = require('gulp-inject'); | |
//inject html | |
gulp.task('inject:html', function() { | |
return gulp.src('./app/*.html') | |
.pipe(inject(gulp.src(['./app/template/*.html']), { | |
starttag: '<!-- inject:{{path}} -->', | |
relative: false, //if true inject:/app/template/menu.html, if false inject:template/menu.html | |
transform: function(filePath, file) { | |
return file.contents.toString('utf8') | |
} | |
})) | |
.pipe(gulp.dest('./app')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment