Skip to content

Instantly share code, notes, and snippets.

@LoyEgor
Last active April 23, 2017 11:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LoyEgor/3bd25ef3e417ec88b5eb1042b28d6a2c to your computer and use it in GitHub Desktop.
Save LoyEgor/3bd25ef3e417ec88b5eb1042b28d6a2c to your computer and use it in GitHub Desktop.
inject html settings
//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